dsh-context-compression-improved 0.10.4 → 0.10.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.
- package/$null +1 -0
- package/.agents/plans/improve/checklist.md +32 -0
- package/.agents/plans/improve/findings.md +102 -0
- package/.agents/plans/improve/spec.md +53 -0
- package/.agents/plans/improve/tasks.md +70 -0
- package/.gitattributes +2 -0
- package/.githooks/pre-push +37 -0
- package/.github/workflows/ci.yml +47 -0
- package/CHANGELOG.de.md +580 -0
- package/CHANGELOG.es.md +588 -0
- package/CHANGELOG.fr.md +576 -0
- package/CHANGELOG.it.md +577 -0
- package/CHANGELOG.ja.md +261 -0
- package/CHANGELOG.ko.md +254 -0
- package/CHANGELOG.md +549 -0
- package/CHANGELOG.ru.md +554 -0
- package/CHANGELOG.zh.md +238 -0
- package/CONTRIBUTING.md +22 -0
- package/README.de.md +96 -0
- package/README.es.md +96 -0
- package/README.fr.md +96 -0
- package/README.it.md +96 -0
- package/README.ja.md +102 -0
- package/README.ko.md +102 -0
- package/README.md +110 -15
- package/README.ru.md +96 -0
- package/README.zh.md +104 -14
- package/SECURITY.md +18 -0
- package/THIRD_PARTY_NOTICES.md +7 -25
- package/assets/board.png +0 -0
- package/assets/context.png +0 -0
- package/docs/assets/context-compression-selector-profiles.jpg +0 -0
- package/docs/assets/context-compression-selector-settings.png +0 -0
- package/docs/compat-0.1.5-report.md +77 -0
- package/docs/installation.de.md +104 -0
- package/docs/installation.es.md +104 -0
- package/docs/installation.fr.md +104 -0
- package/docs/installation.it.md +104 -0
- package/docs/installation.ja.md +78 -0
- package/docs/installation.ko.md +78 -0
- package/docs/installation.md +103 -0
- package/docs/installation.ru.md +104 -0
- package/docs/installation.zh.md +100 -0
- package/docs/repair-log.md +657 -0
- package/eslint.config.js +30 -0
- package/package.json +113 -126
- package/packages/selector/LICENSE +21 -0
- package/packages/selector/README.md +26 -0
- package/packages/selector/README.zh.md +24 -0
- package/packages/selector/THIRD_PARTY_NOTICES.md +32 -0
- package/packages/selector/docs/history-tool-call-working-set-spec.md +112 -0
- package/packages/selector/docs/native-tool-result-selector-spec.md +34 -0
- package/packages/selector/docs/subagent-cache-reuse-spec.md +46 -0
- package/packages/selector/lib/style.css +350 -0
- package/packages/selector/package.json +178 -0
- package/packages/selector/screenshots.json +3 -0
- package/packages/selector/src/client/CompressionProfileControls.tsx +319 -0
- package/packages/selector/src/client/CompressionProfileSelector.module.css +199 -0
- package/packages/selector/src/client/CompressionProfileSelector.tsx +87 -0
- package/packages/selector/src/client/CustomPolicyEditor.tsx +216 -0
- package/packages/selector/src/client/EstimatorControls.tsx +277 -0
- package/packages/selector/src/client/bridge-scope.ts +125 -0
- package/packages/selector/src/client/decode.ts +64 -0
- package/packages/selector/src/client/fab-pos.ts +71 -0
- package/packages/selector/src/client/index.ts +434 -0
- package/packages/selector/src/client/locales/de.ts +160 -0
- package/packages/selector/src/client/locales/es.ts +160 -0
- package/packages/selector/src/client/locales/fr.ts +160 -0
- package/packages/selector/src/client/locales/it.ts +160 -0
- package/packages/selector/src/client/locales/ja.ts +160 -0
- package/packages/selector/src/client/locales/ko.ts +160 -0
- package/packages/selector/src/client/locales/ru.ts +160 -0
- package/packages/selector/src/client/locales.ts +320 -0
- package/packages/selector/src/client/monitor-fab.ts +431 -0
- package/packages/selector/src/client/preset-options.ts +88 -0
- package/packages/selector/src/client/savings-card.tsx +269 -0
- package/packages/selector/src/client/scope-face.ts +24 -0
- package/packages/selector/src/client/settings-section.tsx +149 -0
- package/packages/selector/src/compat/host-generation.ts +96 -0
- package/packages/selector/src/compat/llm-messages.ts +50 -0
- package/packages/selector/src/compat/settings-lease.ts +108 -0
- package/packages/selector/src/compat/tool-result.ts +91 -0
- package/packages/selector/src/css-modules.d.ts +6 -0
- package/packages/selector/src/deepseek-v4-tokenizer.ts +205 -0
- package/packages/selector/src/estimator-catalog.ts +104 -0
- package/packages/selector/src/index.ts +890 -0
- package/packages/selector/src/invariant.ts +113 -0
- package/packages/selector/src/preset-overlay.ts +749 -0
- package/packages/selector/src/profiles.ts +451 -0
- package/packages/selector/src/pruner/content.ts +199 -0
- package/packages/selector/src/pruner/session.ts +97 -0
- package/packages/selector/src/pruner/state.ts +61 -0
- package/packages/selector/src/pruner/tuning.ts +23 -0
- package/packages/selector/src/pruner/types.ts +78 -0
- package/packages/selector/src/pruner.ts +2916 -0
- package/packages/selector/src/runtime/adaptive-cost.ts +205 -0
- package/packages/selector/src/runtime/audit.ts +320 -0
- package/packages/selector/src/runtime/config.ts +800 -0
- package/packages/selector/src/runtime/custom-policy.ts +300 -0
- package/packages/selector/src/runtime/deepseek-official-pricing.ts +298 -0
- package/packages/selector/src/runtime/deepseek-v4-vision-tokens.ts +254 -0
- package/packages/selector/src/runtime/display-prefs.ts +98 -0
- package/packages/selector/src/runtime/measurement.ts +444 -0
- package/packages/selector/src/runtime/monitor.ts +310 -0
- package/packages/selector/src/runtime/panel-command.ts +213 -0
- package/packages/selector/src/runtime/reducers.ts +1755 -0
- package/packages/selector/src/runtime/retrieve.ts +505 -0
- package/packages/selector/src/runtime/savings-integral.ts +117 -0
- package/packages/selector/src/runtime/savings-projection.ts +229 -0
- package/packages/selector/src/runtime/savings-verify.ts +446 -0
- package/packages/selector/src/runtime/savings.ts +526 -0
- package/packages/selector/src/runtime/session-events.ts +30 -0
- package/packages/selector/src/runtime/session-file-decode.ts +523 -0
- package/packages/selector/src/runtime/stats-backfill.ts +541 -0
- package/packages/selector/src/runtime/stats-db.ts +492 -0
- package/packages/selector/src/runtime/stats-schema.ts +123 -0
- package/packages/selector/src/runtime/stats-sync.ts +307 -0
- package/packages/selector/src/runtime/summary-command.ts +127 -0
- package/packages/selector/src/runtime/tail-trim.ts +177 -0
- package/packages/selector/src/runtime/token-count.ts +72 -0
- package/packages/selector/src/runtime/tokenpilot/advisor-prompt.ts +233 -0
- package/packages/selector/src/runtime/tokenpilot/advisor-state.ts +204 -0
- package/packages/selector/src/runtime/tokenpilot/advisor.ts +419 -0
- package/packages/selector/src/runtime/tokenpilot/benefit.ts +200 -0
- package/packages/selector/src/runtime/tokenpilot/dedup.ts +82 -0
- package/packages/selector/src/runtime/tokenpilot/estimator.ts +151 -0
- package/packages/selector/src/runtime/tokenpilot/intent-fold.ts +53 -0
- package/packages/selector/src/runtime/tokenpilot/intent-gate.ts +65 -0
- package/packages/selector/src/runtime/tokenpilot/intent-input-mask.ts +125 -0
- package/packages/selector/src/runtime/tokenpilot/intent-range.ts +37 -0
- package/packages/selector/src/runtime/tokenpilot/locator.ts +129 -0
- package/packages/selector/src/runtime/tokenpilot/read-state.ts +98 -0
- package/packages/selector/src/runtime/tokenpilot/sidechannel.ts +303 -0
- package/packages/selector/src/runtime/tool-names.ts +36 -0
- package/packages/selector/src/runtime/toolclass.ts +103 -0
- package/packages/selector/src/runtime/types.ts +368 -0
- package/packages/selector/src/runtime/value.ts +48 -0
- package/packages/selector/src/settings-bridge.ts +175 -0
- package/packages/selector/tests/advisor-report.host.spec.ts +223 -0
- package/packages/selector/tests/auto-compact.client.spec.tsx +214 -0
- package/packages/selector/tests/built/client-artifact.spec.ts +56 -0
- package/packages/selector/tests/cache-prefix-audit.spec.ts +123 -0
- package/packages/selector/tests/code-skeleton.client.spec.ts +98 -0
- package/packages/selector/tests/compat/compat-narrow-waist.spec.ts +150 -0
- package/packages/selector/tests/custom-contract.client.spec.ts +226 -0
- package/packages/selector/tests/estimator-catalog.spec.ts +70 -0
- package/packages/selector/tests/estimator-channel.client.spec.tsx +253 -0
- package/packages/selector/tests/estimator-route-registration.host.spec.ts +202 -0
- package/packages/selector/tests/fab-pos.client.spec.ts +47 -0
- package/packages/selector/tests/helpers/legacy-namespace.ts +35 -0
- package/packages/selector/tests/helpers/legacy-settings/index.ts +15 -0
- package/packages/selector/tests/helpers/legacy-settings/legacy/provider.d.ts +41 -0
- package/packages/selector/tests/helpers/legacy-settings/legacy/provider.js +647 -0
- package/packages/selector/tests/helpers/legacy-settings/legacy/redact.js +78 -0
- package/packages/selector/tests/helpers/legacy-settings/legacy/util-values.js +234 -0
- package/packages/selector/tests/host-preset-overlay.host.spec.ts +204 -0
- package/packages/selector/tests/monitor-fab.client.spec.ts +240 -0
- package/packages/selector/tests/preset-options-write.client.spec.ts +192 -0
- package/packages/selector/tests/preset-overlay-loader.e2e.host.spec.ts +200 -0
- package/packages/selector/tests/preset-overlay.host.spec.ts +246 -0
- package/packages/selector/tests/profiles.client.spec.tsx +436 -0
- package/packages/selector/tests/ptc-custom-write.client.spec.ts +86 -0
- package/packages/selector/tests/public/package-contract.client.spec.ts +86 -0
- package/packages/selector/tests/runtime/adaptive-cost.spec.ts +167 -0
- package/packages/selector/tests/runtime/advice-never-withholds.host.spec.ts +230 -0
- package/packages/selector/tests/runtime/advisor-invariant.spec.ts +272 -0
- package/packages/selector/tests/runtime/advisor.spec.ts +226 -0
- package/packages/selector/tests/runtime/audit.spec.ts +275 -0
- package/packages/selector/tests/runtime/auto-compact-config.spec.ts +523 -0
- package/packages/selector/tests/runtime/char-basis.spec.ts +30 -0
- package/packages/selector/tests/runtime/code-skeleton.spec.ts +152 -0
- package/packages/selector/tests/runtime/deepseek-official-pricing.spec.ts +186 -0
- package/packages/selector/tests/runtime/deepseek-v4-tokenizer.spec.ts +122 -0
- package/packages/selector/tests/runtime/deepseek-v4-vision-tokens.spec.ts +122 -0
- package/packages/selector/tests/runtime/deprecated-preset-options.spec.ts +96 -0
- package/packages/selector/tests/runtime/fixtures/profile-baseline.json +273 -0
- package/packages/selector/tests/runtime/fixtures/session-v4-dump.jsonl +46 -0
- package/packages/selector/tests/runtime/fixtures/tokenizer-golden.json +106 -0
- package/packages/selector/tests/runtime/fixtures/vision-golden.json +459 -0
- package/packages/selector/tests/runtime/frequency-longstrings.spec.ts +74 -0
- package/packages/selector/tests/runtime/fresh-gate.spec.ts +43 -0
- package/packages/selector/tests/runtime/html-reducer.spec.ts +212 -0
- package/packages/selector/tests/runtime/intent-gate.spec.ts +62 -0
- package/packages/selector/tests/runtime/intent-summary.spec.ts +156 -0
- package/packages/selector/tests/runtime/jsonl-reducer.spec.ts +79 -0
- package/packages/selector/tests/runtime/line-mapping.spec.ts +153 -0
- package/packages/selector/tests/runtime/monitor.spec.ts +354 -0
- package/packages/selector/tests/runtime/panel-command.spec.ts +101 -0
- package/packages/selector/tests/runtime/prose-reducers.spec.ts +133 -0
- package/packages/selector/tests/runtime/ptc-profile.spec.ts +133 -0
- package/packages/selector/tests/runtime/public/public-runtime.spec.ts +2795 -0
- package/packages/selector/tests/runtime/read-input-cap.spec.ts +33 -0
- package/packages/selector/tests/runtime/savings-accounting.spec.ts +291 -0
- package/packages/selector/tests/runtime/savings-integral.spec.ts +169 -0
- package/packages/selector/tests/runtime/savings-projection.spec.ts +89 -0
- package/packages/selector/tests/runtime/savings-verify.spec.ts +226 -0
- package/packages/selector/tests/runtime/savings.spec.ts +139 -0
- package/packages/selector/tests/runtime/search-reducer.spec.ts +110 -0
- package/packages/selector/tests/runtime/session-events.spec.ts +27 -0
- package/packages/selector/tests/runtime/session-file-decode.spec.ts +281 -0
- package/packages/selector/tests/runtime/settings-unwrap.spec.ts +58 -0
- package/packages/selector/tests/runtime/sidechannel.spec.ts +241 -0
- package/packages/selector/tests/runtime/stats-backfill-scheduler.spec.ts +167 -0
- package/packages/selector/tests/runtime/stats-backfill.spec.ts +350 -0
- package/packages/selector/tests/runtime/stats-db.spec.ts +361 -0
- package/packages/selector/tests/runtime/stats-privacy.spec.ts +55 -0
- package/packages/selector/tests/runtime/stats-sync.spec.ts +278 -0
- package/packages/selector/tests/runtime/summary-command.spec.ts +154 -0
- package/packages/selector/tests/runtime/toc-and-bundled.spec.ts +159 -0
- package/packages/selector/tests/runtime/tokenizer-golden.spec.ts +53 -0
- package/packages/selector/tests/runtime/tokenpilot/benefit.spec.ts +217 -0
- package/packages/selector/tests/runtime/tokenpilot/dedup.spec.ts +52 -0
- package/packages/selector/tests/runtime/tokenpilot/estimator.spec.ts +79 -0
- package/packages/selector/tests/runtime/tokenpilot/locator.spec.ts +76 -0
- package/packages/selector/tests/runtime/tokenpilot/profile-baseline.spec.ts +121 -0
- package/packages/selector/tests/runtime/tokenpilot/read-state.spec.ts +82 -0
- package/packages/selector/tests/runtime/toolclass.spec.ts +156 -0
- package/packages/selector/tests/runtime/value.spec.ts +23 -0
- package/packages/selector/tests/savings-sessions.client.spec.tsx +140 -0
- package/packages/selector/tests/settings-seat.client.spec.ts +215 -0
- package/packages/selector/tests/standing-generation.host.spec.ts +724 -0
- package/packages/selector/tests/subagent-cache-reuse.host.spec.ts +269 -0
- package/packages/selector/tests/support/cache-prefix-audit.ts +105 -0
- package/packages/selector/tests/support/mock-adapter.ts +37 -0
- package/packages/selector/tests/support/ui-primitives.tsx +34 -0
- package/packages/selector/tsconfig.json +11 -0
- package/packages/selector/tsdown.client.config.ts +102 -0
- package/packages/selector/tsdown.config.ts +20 -0
- package/pnpm-workspace.yaml +76 -0
- package/screenshots.json +6 -3
- package/scripts/capture-profile-baseline.mjs +42 -0
- package/scripts/cell-browser-e2e.mjs +354 -0
- package/scripts/generate-tokenizer-fixtures.py +81 -0
- package/scripts/generate-vision-fixtures.py +208 -0
- package/scripts/hosts.mjs +79 -0
- package/scripts/packed-components-smoke.mjs +763 -0
- package/scripts/packed-install-e2e.mjs +1346 -0
- package/scripts/sync-hosts.mjs +174 -0
- package/scripts/toolclass-corpus-replay.mjs +281 -0
- package/scripts/verify-release.mjs +338 -0
- package/tests/TEST_INVENTORY.md +41 -0
- package/tsconfig.base.json +18 -0
- package/tsconfig.json +7 -0
- package/tsconfig.tests.json +15 -0
- package/vitest.built.config.ts +9 -0
- package/vitest.config.ts +54 -0
- /package/{assets → packages/selector/assets}/deepseek-v4/LICENSE.DeepSeek-V4-Pro.txt +0 -0
- /package/{assets → packages/selector/assets}/deepseek-v4/manifest.json +0 -0
- /package/{assets → packages/selector/assets}/deepseek-v4/tokenizer.json +0 -0
- /package/{assets → packages/selector/assets}/deepseek-v4/tokenizer_config.json +0 -0
- /package/{assets → packages/selector/assets}/deepseek-v4-vision-exp/LICENSE.DeepSeek-V4-Flash-Vision-Exp.txt +0 -0
- /package/{assets → packages/selector/assets}/deepseek-v4-vision-exp/manifest.json +0 -0
- /package/{assets → packages/selector/assets}/deepseek-v4-vision-exp/tokenizer.json +0 -0
- /package/{assets → packages/selector/assets}/deepseek-v4-vision-exp/tokenizer_config.json +0 -0
- /package/{cordis.patch.yml → packages/selector/cordis.patch.yml} +0 -0
- /package/{dsh.plugin.json → packages/selector/dsh.plugin.json} +0 -0
- /package/{lib → packages/selector/lib}/client.d.ts +0 -0
- /package/{lib → packages/selector/lib}/client.js +0 -0
- /package/{lib → packages/selector/lib}/index.d.ts +0 -0
- /package/{lib → packages/selector/lib}/index.js +0 -0
- /package/{lib → packages/selector/lib}/invariant.d.ts +0 -0
- /package/{lib → packages/selector/lib}/invariant.js +0 -0
- /package/{lib → packages/selector/lib}/profiles.d.ts +0 -0
- /package/{lib → packages/selector/lib}/pruner.d.ts +0 -0
- /package/{lib → packages/selector/lib}/pruner.js +0 -0
- /package/{lib → packages/selector/lib}/savings-integral.js +0 -0
- /package/{lib → packages/selector/lib}/tail-trim.js +0 -0
- /package/{lib → packages/selector/lib}/tool-result.js +0 -0
|
@@ -0,0 +1,657 @@
|
|
|
1
|
+
# Repair log
|
|
2
|
+
|
|
3
|
+
Cross-version ledger of defects that break the **install / boot** path. Every branch and
|
|
4
|
+
version must leave its verdict here (affected / unaffected / fixed) before it ships.
|
|
5
|
+
|
|
6
|
+
Read this file before starting a new line (see `CONTRIBUTING.md`). A defect class already
|
|
7
|
+
recorded here is expected to be *re-checked*, not re-discovered.
|
|
8
|
+
|
|
9
|
+
- One defect, one `D#` id.
|
|
10
|
+
- One entry must contain: symptom / root cause / evidence / affected surface / fix / verification.
|
|
11
|
+
- Evidence means a command and its observed output, not a description of the code.
|
|
12
|
+
|
|
13
|
+
Defects that ship to the **settings surface** rather than the boot path use the `U#` series and
|
|
14
|
+
keep the same six-part shape. They are recorded here because they are reported the same way —
|
|
15
|
+
from a real machine, by someone who cannot tell a gate from a bug.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## D1 — Host plugin entry statically imports a sibling package
|
|
20
|
+
|
|
21
|
+
**Symptom.** `dsh web` aborts while loading the plugin tree:
|
|
22
|
+
|
|
23
|
+
```text
|
|
24
|
+
failed to import loader entry context-compression-improved-bundle
|
|
25
|
+
(dsh-context-compression-improved): Cannot find package
|
|
26
|
+
'dsh-context-compression-improved-runtime' imported from
|
|
27
|
+
<profile>/node_modules/dsh-context-compression-improved/packages/selector/lib/index.js
|
|
28
|
+
code: 'ERR_MODULE_NOT_FOUND'
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
**Root cause.** The repository was installed whole via a git dependency, so pnpm only
|
|
32
|
+
installs what the **root** manifest declares. The root manifest declared no
|
|
33
|
+
`dependencies`, so the sibling package was never materialized — and
|
|
34
|
+
`packages/selector/lib/index.js:3` uses a top-level static `import` of it, which throws
|
|
35
|
+
during module evaluation.
|
|
36
|
+
|
|
37
|
+
**Cascade.** The Host entry never loads → `settings.register('context-compression', …)`
|
|
38
|
+
never runs → the browser `SettingsScopeSnapshot.writable` stays at its initial `false` →
|
|
39
|
+
every control in the settings panel renders `disabled`. The panel itself is still visible
|
|
40
|
+
because the client bundle is resolved from `dsh.client` metadata and is unaffected by this
|
|
41
|
+
failure.
|
|
42
|
+
|
|
43
|
+
**Evidence (committed artifacts, not a working tree).**
|
|
44
|
+
|
|
45
|
+
| Branch | `packages/selector/lib/index.js` |
|
|
46
|
+
| --- | --- |
|
|
47
|
+
| `feat/ctx-preset-v2` @ `455f74f` | `L3: import { … } from "dsh-context-compression-improved-runtime";` — the crash site |
|
|
48
|
+
| `compat/0.1.5` @ `d7c592d` | no top-level import; only `modulePath("…-runtime", import.meta.resolve("…-runtime"))` |
|
|
49
|
+
|
|
50
|
+
**Affected.** `feat/ctx-preset-v2` (the crash itself).
|
|
51
|
+
|
|
52
|
+
**Fix.** Merge into a single package: the entry imports `./runtime/config.ts` from inside
|
|
53
|
+
its own package.
|
|
54
|
+
|
|
55
|
+
**Verification.** `grep` over `lib/**/*.js` must find no
|
|
56
|
+
`from "dsh-context-compression-improved-runtime"`. The frozen provenance literal (D5 note
|
|
57
|
+
below) is the only remaining occurrence and is required.
|
|
58
|
+
|
|
59
|
+
**Status.** Fixed on the merge branch.
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## D2 — Root manifest missing the install contract
|
|
64
|
+
|
|
65
|
+
**Symptom.** `dsh plugin add github:<owner>/<repo>` completes, yet the profile gains no
|
|
66
|
+
usable plugin: no bundle row, no resolvable entry.
|
|
67
|
+
|
|
68
|
+
**Root cause.** A git install reads the **root** manifest. Without `main` / `exports` /
|
|
69
|
+
`dsh.client.inject` / `dsh.bundle.patch` there is nothing for the harness to mount; and if
|
|
70
|
+
the root name is still a private workspace name with `"private": true`, pnpm installs a
|
|
71
|
+
private package nothing can load.
|
|
72
|
+
|
|
73
|
+
**Evidence.**
|
|
74
|
+
|
|
75
|
+
| Branch | Root manifest |
|
|
76
|
+
| --- | --- |
|
|
77
|
+
| `feat/ctx-preset-v2` @ `455f74f` | correct name, has `main`/`exports`/`dsh`; but `dependencies` **empty**, `exports` missing `./pruner` and `./invariant` |
|
|
78
|
+
| `compat/0.1.5` @ `d7c592d` | `dsh-context-compression-improved-workspace`, `private: true`, **no** `main`/`exports`/`dsh`/`dependencies` |
|
|
79
|
+
| `main` / `baseline/pre-god-module-split` @ `e337bf5` | same as compat, plus **zero** `lib/` artifacts committed |
|
|
80
|
+
|
|
81
|
+
**Affected.** `compat/0.1.5`, `baseline/pre-god-module-split`, `main` (fully);
|
|
82
|
+
`feat/ctx-preset-v2` (partially: empty dependencies, incomplete exports).
|
|
83
|
+
|
|
84
|
+
`baseline/pre-god-module-split` is a pre-split baseline, not a distribution: it has no
|
|
85
|
+
install contract and no built artifacts. Do not use it as a rollback target.
|
|
86
|
+
|
|
87
|
+
**Fix.** The root manifest carries the install contract: `name`, `main`, `types`,
|
|
88
|
+
`exports`, `dependencies`, `dsh`. `dependencies` lists the real third-party runtime
|
|
89
|
+
dependencies (`@huggingface/tokenizers`, `js-yaml`).
|
|
90
|
+
|
|
91
|
+
**Verification.** `git show <branch>:package.json` field-by-field; after a real
|
|
92
|
+
`dsh plugin add`, confirm `node_modules/<pkg>` exists and contains `lib/index.js`.
|
|
93
|
+
|
|
94
|
+
**Status.** Fixed on the merge branch for `dependencies` / `./pruner`. `./invariant` was
|
|
95
|
+
added to the root `exports` by the closure commit — the root and the package manifest now
|
|
96
|
+
export the same four subpaths (`.`, `./invariant`, `./pruner`, `./client`). See the
|
|
97
|
+
verification ledger below for the command-level evidence.
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## D3 — Build chunks not committed: the same crash under a different filename
|
|
102
|
+
|
|
103
|
+
**Symptom.** After the merge, the built entry starts with:
|
|
104
|
+
|
|
105
|
+
```js
|
|
106
|
+
// packages/selector/lib/index.js:1
|
|
107
|
+
import { … } from "./config.js";
|
|
108
|
+
// packages/selector/lib/invariant.js:1
|
|
109
|
+
import { … } from "./tail-trim.js";
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
tsdown splits a shared chunk out of every entry that reuses a module.
|
|
113
|
+
|
|
114
|
+
**Root cause.** This repository commits `lib/` because pnpm refuses a `prepare` script on a
|
|
115
|
+
git dependency, so consumers can only install prebuilt artifacts. After the merge the new
|
|
116
|
+
artifacts — `lib/config.js`, `lib/tail-trim.js`, `lib/pruner.js`, `lib/pruner.d.ts`,
|
|
117
|
+
`src/deepseek-v4-tokenizer.ts` — were **untracked** while `lib/index.js` already imported
|
|
118
|
+
them. Pushing in that state makes a git install fetch an entry whose chunk does not exist:
|
|
119
|
+
the identical `ERR_MODULE_NOT_FOUND`, only the specifier changes from the sibling package
|
|
120
|
+
to `./config.js`.
|
|
121
|
+
|
|
122
|
+
A git install fetches exactly the **tracked** tree, so `pnpm test:e2e:packed` cannot catch
|
|
123
|
+
this: `npm pack` builds from the working tree and happily includes untracked files.
|
|
124
|
+
|
|
125
|
+
**Evidence.**
|
|
126
|
+
|
|
127
|
+
- `git ls-files packages/selector/lib` listed only the seven pre-merge files.
|
|
128
|
+
- `git status --porcelain` showed the five untracked artifacts above.
|
|
129
|
+
- Before the gate was added, `pnpm verify:release` printed
|
|
130
|
+
`release verification: OK` — the release gate did not cover the artifact graph.
|
|
131
|
+
- Contrast with history, showing this is merge-introduced: on `feat/ctx-preset-v2` and
|
|
132
|
+
`compat/0.1.5`, `packages/runtime/lib/tail-trim.js` is committed, and the selector entry
|
|
133
|
+
is self-contained with no relative imports.
|
|
134
|
+
|
|
135
|
+
**Affected.** Any release built from the merged single-package layout, i.e. every future
|
|
136
|
+
version of this repository. Treat it as a permanent gate, not a one-off fix.
|
|
137
|
+
|
|
138
|
+
**Fix.**
|
|
139
|
+
1. Commit `lib/**` together with the sources, including every chunk and entry.
|
|
140
|
+
2. Gate it: every relative import in a shipped artifact must (a) resolve to an existing
|
|
141
|
+
file, (b) be covered by the package `files` allowlist (packed install), and (c) be
|
|
142
|
+
git-tracked (git install).
|
|
143
|
+
|
|
144
|
+
The gate is scoped to the **import graph**. Unreferenced build by-products such as
|
|
145
|
+
`lib/style.css` are excluded: its rules are already carried inline by `lib/client.js`
|
|
146
|
+
(the `\0dsh-context-compression-css:` region), nothing in the repository reads the file,
|
|
147
|
+
and the `files` allowlist deliberately drops it from the tarball. Requiring it would mean
|
|
148
|
+
widening the allowlist to ship dead weight.
|
|
149
|
+
|
|
150
|
+
**Verification.** `scripts-dist/verify-release.js` (compiled from `scripts/verify-release.ts`). Observed:
|
|
151
|
+
|
|
152
|
+
```text
|
|
153
|
+
# untracked chunk present
|
|
154
|
+
Error: release verification: packages/selector/lib/config.js is not committed;
|
|
155
|
+
a git install would fetch an incomplete artifact graph
|
|
156
|
+
|
|
157
|
+
# after git add (the gate reads the index, so staging is enough)
|
|
158
|
+
release verification: OK
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
**Status.** Gate implemented and verified red → green. The root-cause fix is the
|
|
162
|
+
`git add`, applied in the merge commit.
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
## D4 — Consumer profile leftovers
|
|
167
|
+
|
|
168
|
+
**Symptom.** Even with the package fixed, a profile can still install the wrong thing or
|
|
169
|
+
fail to install.
|
|
170
|
+
|
|
171
|
+
**Evidence (`web` profile).**
|
|
172
|
+
|
|
173
|
+
- `package.json` depended on `…-selector-workspace` at
|
|
174
|
+
`github:<owner>/<repo>#baseline/pre-god-module-split` — a spec **without**
|
|
175
|
+
`&path:/packages/selector`, which resolves to the private workspace root and installs
|
|
176
|
+
nothing usable.
|
|
177
|
+
- `pnpm-workspace.yaml` kept an `overrides` entry pointing at the now-deleted
|
|
178
|
+
`packages/runtime` path.
|
|
179
|
+
- `node_modules` held nothing but the useless workspace package.
|
|
180
|
+
|
|
181
|
+
**Affected.** Any profile that installs this plugin.
|
|
182
|
+
|
|
183
|
+
**Fix.** Remove the stale dependency and the dead override; install by the single-package
|
|
184
|
+
spec (no `&path:` needed once the root manifest is the install face).
|
|
185
|
+
|
|
186
|
+
**Correction.** An earlier analysis claimed `allowBuilds` for `@huggingface/tokenizers` was
|
|
187
|
+
a blocker. `@huggingface/tokenizers@0.1.3` has no `install`/`postinstall` script — `dist/`
|
|
188
|
+
ships prebuilt — and the repository's own packed E2E writes a consumer workspace manifest
|
|
189
|
+
of just `packages: []`. Adding the `allowBuilds` entry is precautionary, not required.
|
|
190
|
+
|
|
191
|
+
**Status.** Delivered as a manual script; not executed by the maintainer agent.
|
|
192
|
+
|
|
193
|
+
---
|
|
194
|
+
|
|
195
|
+
## D5 — `compat/0.1.5` predates the install contract
|
|
196
|
+
|
|
197
|
+
**Verdict: it must inherit.** `compat/0.1.5` @ `d7c592d` is four commits behind
|
|
198
|
+
`feat/ctx-preset-v2` (`0b20bf2`, `cd03575`, `4635d19`, `455f74f`), so what it needs is not
|
|
199
|
+
merely the merge but the whole install contract:
|
|
200
|
+
|
|
201
|
+
1. the root manifest contract (D2) — it currently cannot be mounted at all;
|
|
202
|
+
2. the single-package merge (structural fix for D1) — it is still two packages, with
|
|
203
|
+
neither manifest declaring the other as an installable dependency, so a git install
|
|
204
|
+
cannot materialize the runtime package: the same root cause, a different presentation;
|
|
205
|
+
3. the artifact-graph gate (D3) and the profile hygiene (D4).
|
|
206
|
+
|
|
207
|
+
Its entry lacks a top-level cross-package import only because it resolves the runtime
|
|
208
|
+
package lazily through `import.meta.resolve`. That is why it fails as "no bundle to load"
|
|
209
|
+
instead of a load-time throw. Same disease, different symptom — do not read it as
|
|
210
|
+
"unaffected".
|
|
211
|
+
|
|
212
|
+
**Replay, not merge.** `compat/0.1.5` carries 0.1.5-rc.2-only adaptations (client slot
|
|
213
|
+
names, `engines.dsh`, pinned overrides, lazy service resolution, estimator host route,
|
|
214
|
+
`/api` route prefix). A `git merge` would drag the old-line adaptations back, so the merge
|
|
215
|
+
is replayed file by file on that branch instead.
|
|
216
|
+
|
|
217
|
+
**Status.** Not started.
|
|
218
|
+
|
|
219
|
+
---
|
|
220
|
+
|
|
221
|
+
## D6 — Consumer profile blocks dependency reconciliation (host precondition)
|
|
222
|
+
|
|
223
|
+
**Scope note.** This is *not* a defect of this repository. It is recorded here because it
|
|
224
|
+
blocks the real-machine verification step that every branch needs, and because CI is
|
|
225
|
+
structurally blind to it.
|
|
226
|
+
|
|
227
|
+
**Symptom.** `pnpm install` in the `web` profile fails, at a **different path on every run**:
|
|
228
|
+
|
|
229
|
+
```text
|
|
230
|
+
cannot create directory at "...\node_modules\katex\node_modules\commander_pacquet-stage_…":
|
|
231
|
+
拒绝访问。 (os error 5)
|
|
232
|
+
|
|
233
|
+
failed to remove existing directory "...\node_modules\better-sqlite3" prior to swap:
|
|
234
|
+
拒绝访问。 (os error 5)
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
Progress advances each run (`added 151 → 159 → 205`). The install is not wedged — it is
|
|
238
|
+
walking a list of blockers, one per run.
|
|
239
|
+
|
|
240
|
+
**Root cause — two independent sources of `os error 5`. Do not conflate them.**
|
|
241
|
+
|
|
242
|
+
1. **ACL denies write**, at exactly one directory: `node_modules\katex\node_modules` lists
|
|
243
|
+
only `BUILTIN\Users: ReadAndExecute` and does not name the interactive user at all.
|
|
244
|
+
2. **A mapped native module is held by a live process.** `better-sqlite3` grants the
|
|
245
|
+
interactive user `FullControl` on both itself and its nested `node_modules`, yet deletion
|
|
246
|
+
still fails. `session-query-sqlite` is enabled and `dsh web` is running, so
|
|
247
|
+
`better-sqlite3\build\Release\better_sqlite3.node` is mapped into that process; Windows
|
|
248
|
+
returns `ERROR_ACCESS_DENIED` when asked to delete a mapped image. No ACL change fixes
|
|
249
|
+
this one — only stopping the process does.
|
|
250
|
+
|
|
251
|
+
**Criterion warning — never test this by ownership.** Measured here:
|
|
252
|
+
|
|
253
|
+
| criterion | flagged |
|
|
254
|
+
| --- | --- |
|
|
255
|
+
| owner is not the interactive user | **211** |
|
|
256
|
+
| the interactive user actually lacks write | **0** of 269 package dirs, plus **1** nested |
|
|
257
|
+
|
|
258
|
+
Ownership is `BUILTIN\Administrators` almost everywhere (the profile was evidently produced
|
|
259
|
+
by one elevated install), while the interactive user holds explicit `FullControl` in nearly
|
|
260
|
+
all of them. An ownership-based fix would take ownership of 211 directories to solve one.
|
|
261
|
+
Test the **effective write right** instead.
|
|
262
|
+
|
|
263
|
+
**Affected.** Every real-machine verification on this host, on every branch — including the
|
|
264
|
+
`compat/0.1.5` replay, which cannot be validated anywhere else.
|
|
265
|
+
|
|
266
|
+
**Fix.** Stop `dsh web`; grant write on the one genuinely denied directory; re-run
|
|
267
|
+
`pnpm install --no-frozen-lockfile`; restart. Delivered as
|
|
268
|
+
`DSH-ccp-单包修复-04-node_modules依赖收敛阻塞.ps1` — diagnose / repair / re-verify, dry-run
|
|
269
|
+
capable, and it never stops the service for you.
|
|
270
|
+
|
|
271
|
+
**Verification.** The script's `-DryRun` reports one true target and names the one path.
|
|
272
|
+
|
|
273
|
+
**Status. Resolved** in the maintenance window. The consumer ran a plain `pnpm install` in
|
|
274
|
+
the profile and it completed: `Packages: +256 -16`, `Progress: resolved 256, reused 256`,
|
|
275
|
+
`Done in 11.1s using pnpm v12.4.1`, exit 0.
|
|
276
|
+
|
|
277
|
+
**Resolution evidence (read-only re-check after the install):**
|
|
278
|
+
|
|
279
|
+
| Check | Result |
|
|
280
|
+
| --- | --- |
|
|
281
|
+
| `pnpm-lock.yaml` references `dsh-context-compression-selector-workspace` | **none** — lockfile and `package.json` agree again |
|
|
282
|
+
| `node_modules\dsh-context-compression*` | exactly one directory, `dsh-context-compression-improved` |
|
|
283
|
+
| `*_pacquet-stage_*` residue | none |
|
|
284
|
+
| plugin `packages/selector/lib/**` | all ten artifacts present, `invariant.js` 3927 B — byte-size identical to the source build |
|
|
285
|
+
| `dsh.profile.bundles` row | `dsh-context-compression-improved` still listed |
|
|
286
|
+
|
|
287
|
+
Two things follow for the record. First, the lockfile inconsistency tracked here was a
|
|
288
|
+
**symptom** of the failed installs, not a separate defect: once one install succeeded, it
|
|
289
|
+
cleared itself — no manual lockfile surgery was needed. Second, the blockage cleared **by
|
|
290
|
+
retrying**, without the elevated ACL repair. That does not retire the finding — the `katex`
|
|
291
|
+
ACL hole is still real and will bite the next replacement of that subtree — but it does mean
|
|
292
|
+
the earlier per-run progress (`added 151 → 159 → 205`) was the decisive mechanism: each
|
|
293
|
+
attempt converged further and the last one finished. Record it as *cleared by convergence*,
|
|
294
|
+
not as *fixed by the script*; `-04` remains the tool of record if a future install stalls on
|
|
295
|
+
the same signature.
|
|
296
|
+
|
|
297
|
+
---
|
|
298
|
+
|
|
299
|
+
## D7 — The estimator catalog route never registered: a detached method lost `this`
|
|
300
|
+
|
|
301
|
+
**Symptom.** The settings card's host-route dropdowns stayed empty. An authenticated
|
|
302
|
+
`GET /api/dsh-context-compression-improved/estimator-catalog` answered 404 while a sibling
|
|
303
|
+
plugin's `/api/dsh-perm-gate/receiver` answered 200 in the same breath.
|
|
304
|
+
|
|
305
|
+
**Root cause.** `asWebServer` duck-typed the `webServer` service by pulling `register` off it
|
|
306
|
+
and returning a fresh wrapper:
|
|
307
|
+
|
|
308
|
+
```ts
|
|
309
|
+
const register = value?.register
|
|
310
|
+
return { register } // `this` is now the wrapper
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
`dsh-host-webserver`'s `register` reads its own route tables:
|
|
314
|
+
|
|
315
|
+
```js
|
|
316
|
+
const table = route.kind === "exact" ? this.exact : this.prefixes;
|
|
317
|
+
if (table.has(route.path)) … // L178 — `table` is undefined, TypeError
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
`this` was the wrapper, so `this.exact` / `this.prefixes` were `undefined`, the host threw
|
|
321
|
+
inside `register`, and the plugin's catch-all swallowed it. **The helper had never once
|
|
322
|
+
registered a route since it was written.**
|
|
323
|
+
|
|
324
|
+
**Why it stayed invisible.** On the 0.1.2 host the `dsh web` terminal prints no plugin
|
|
325
|
+
`ctx.logger` output at all — a full boot produced 1350 bytes containing only Node's
|
|
326
|
+
experimental warning and two `dsh web:` lines — and a plugin-load failure travels the same
|
|
327
|
+
logger. A swallowed throw and a plugin that quietly did nothing were observationally
|
|
328
|
+
identical. Once the diagnostic moved to `console` (as `dsh-perm-gate` already does on this
|
|
329
|
+
host), the real frame appeared:
|
|
330
|
+
|
|
331
|
+
```
|
|
332
|
+
TypeError: Cannot read properties of undefined (reading 'has')
|
|
333
|
+
at Object.register (dsh-host-webserver/lib/index.js:178:13)
|
|
334
|
+
at Object.apply (cordis/lib/index.js:120:36)
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
**Fix.** `return value as WebServerLike` — pass the service itself; `dsh-perm-gate` works
|
|
338
|
+
for exactly this reason.
|
|
339
|
+
|
|
340
|
+
**Verification.** Cordis does **not** bind service methods: on a bare `Context`, both a
|
|
341
|
+
detached call and a wrapped one lose `this`. On the real host, after installing this fix,
|
|
342
|
+
`/api/dsh-context-compression-improved/estimator-catalog` answers **200** with a full
|
|
343
|
+
catalog (four provider groups), `/endpoint/…` answers 200, perm-gate stays 200, and a
|
|
344
|
+
garbage path stays 401.
|
|
345
|
+
|
|
346
|
+
**Guard.** `packages/selector/tests/estimator-route-registration.host.spec.ts` now mounts a
|
|
347
|
+
stand-in whose `register` reads its tables off `this`, mirroring the host. Against the
|
|
348
|
+
previous implementation it fails **3 of 5** cases with `expected [] to deeply equal […]` —
|
|
349
|
+
the same empty route table the host exhibited. The earlier version of that stand-in recorded
|
|
350
|
+
routes in a closure, so it could never have caught this.
|
|
351
|
+
|
|
352
|
+
**Withdrawn hypotheses.** Everything this ledger recorded before the fix about the cause —
|
|
353
|
+
narrowing the injection gate, isolation scope, and moving to the `connection` service — was
|
|
354
|
+
a false trail produced by the silence. Two of them are worth keeping as *non*-causes:
|
|
355
|
+
isolation is opt-in and this row never opted in, and `connection.rpc` is the wrong transport
|
|
356
|
+
here for reasons the project's own `upgrade-pitfalls` §2.1 records independently.
|
|
357
|
+
|
|
358
|
+
---
|
|
359
|
+
|
|
360
|
+
## D8 — The search reducer dropped 21.2% of hits and never reported where they went
|
|
361
|
+
|
|
362
|
+
**Symptom.** Large `grep`/`rg` results compressed by `search-by-file` lost every hit the
|
|
363
|
+
per-file "first 4 + last" rule did not keep, and the file header only said `(592 matches)`
|
|
364
|
+
with no line numbers. The model could not tell which hits were dropped or where to re-read.
|
|
365
|
+
|
|
366
|
+
**Root cause.** `reduceSearch` filled each file's keep-set from index 0 (`keep.size < 5`)
|
|
367
|
+
and reported only counts. Nothing in the output identified the omitted hit positions, so the
|
|
368
|
+
loss was invisible and unrecoverable except by re-running the search.
|
|
369
|
+
|
|
370
|
+
**Evidence.** 14 real sessions (18.6M characters, DSH 0.1.5-rc.2): 186 search events /
|
|
371
|
+
5,301 hits; per-file median 18, p90 55, max 592; 1,122 hits (21.2%) discarded silently.
|
|
372
|
+
|
|
373
|
+
**Affected surface.** `packages/selector/src/runtime/reducers.ts` (`reduceSearch`).
|
|
374
|
+
|
|
375
|
+
**Fix.** Two-tier folding (R10): L1 is a lossless per-file locator
|
|
376
|
+
(`## <path> (N matches) L12,L15,…`, one line number per hit, budget reserved first); L2 is
|
|
377
|
+
the content quota, water-filled round-robin so no file vanishes. When L1 itself cannot fit
|
|
378
|
+
the shortfall is announced (withheld file/match counts), never silently truncated.
|
|
379
|
+
|
|
380
|
+
**Verification.** `packages/selector/tests/runtime/search-reducer.spec.ts`: a 592-hit file
|
|
381
|
+
reports 592 locator numbers; water-filling serves every file before any file takes a second
|
|
382
|
+
row; withheld locators are announced in the output.
|
|
383
|
+
|
|
384
|
+
---
|
|
385
|
+
|
|
386
|
+
## D9 — HTML fell into `pi-head`, which kept the `<head>` and dropped the body
|
|
387
|
+
|
|
388
|
+
**Symptom.** Fetched/compressed HTML pages kept `<!DOCTYPE>`, `<meta>`, `<link>`,
|
|
389
|
+
`<script>` and `<style>` — the metadata — while the entire body content disappeared.
|
|
390
|
+
|
|
391
|
+
**Root cause.** `looksLikeSourceCode` matches no HTML tags (its patterns cover
|
|
392
|
+
declarations/imports/decorators only), so pages fell through to the head/tail fallbacks, and
|
|
393
|
+
`reduceHead` takes from the top — exactly the worst segment for HTML.
|
|
394
|
+
|
|
395
|
+
**Evidence.** `CODE_STRUCTURE_PATTERN` / `CODE_IMPORT_PATTERN` / `CODE_DECORATOR_PATTERN`
|
|
396
|
+
match none of `<html|<div|<script|…`; the repository carried zero HTML-input tests (31
|
|
397
|
+
`<html|<div|<script` hits, all in TSX sources and tokenizer vocabularies).
|
|
398
|
+
|
|
399
|
+
**Affected surface.** `packages/selector/src/runtime/reducers.ts` (candidate chain).
|
|
400
|
+
|
|
401
|
+
**Fix.** Two-stage reduction (R13): `html-slim` strips comments, script/style/noscript/svg/
|
|
402
|
+
head elements, data URIs, non-whitelisted attributes (`href/src/alt/title/id` survive) and
|
|
403
|
+
inline-tag markup, line-aligned so original-event line numbers survive; `html-skeleton`
|
|
404
|
+
keeps the heading hierarchy, section first lines and table header rows under tighter budgets.
|
|
405
|
+
Classification is pure form (≥3 markup-tag lines in the first 400).
|
|
406
|
+
|
|
407
|
+
**Verification.** `packages/selector/tests/runtime/html-reducer.spec.ts`: body paragraphs
|
|
408
|
+
and headings survive; script/style/comment/data-URI content is gone; the skeleton fallback
|
|
409
|
+
cites original line ranges; TS generics/comparisons are not misclassified as HTML.
|
|
410
|
+
|
|
411
|
+
---
|
|
412
|
+
|
|
413
|
+
## U1 — The estimator card vanished off TokenPilot-inspired instead of explaining its gate
|
|
414
|
+
|
|
415
|
+
**Symptom.** With any profile other than TokenPilot-inspired selected, the Settings page showed
|
|
416
|
+
no estimator section at all. A reader who had configured nothing could not tell whether the
|
|
417
|
+
feature was missing, broken, or gated — the first real-machine report of Defect A was exactly
|
|
418
|
+
this, and it was filed alongside D7 even though the two have nothing in common.
|
|
419
|
+
|
|
420
|
+
**Root cause.** The render was `current !== 'tokenpilot-inspired' ? null : <EstimatorControls …/>`.
|
|
421
|
+
The condition is right: `runtime/config.ts` merges `presetOptions` over the tokenpilot-inspired
|
|
422
|
+
defaults alone (`mergePresetOptions`), and `resolvePolicy(config, 'balanced').presetOptions` is
|
|
423
|
+
`undefined`, so no other profile can carry an estimator channel. What was wrong is that the gate
|
|
424
|
+
was *rendered as nothing*. The profile card that unlocks the section sits elsewhere on the page,
|
|
425
|
+
and the one element that would have named it was the section being hidden — a gate the reader
|
|
426
|
+
cannot see is indistinguishable from an absent feature.
|
|
427
|
+
|
|
428
|
+
**Fix.** Render `EstimatorInactiveNotice` in place of the controls: same `<section>`, same
|
|
429
|
+
`#context-compression-estimator-title` heading anchor, one paragraph naming the current profile
|
|
430
|
+
and the profile that unlocks the card. Losing the heading was half the defect, so the heading
|
|
431
|
+
stays. **The gate is unchanged** — no estimator control exists off TokenPilot-inspired, and no
|
|
432
|
+
other profile gains `presetOptions`.
|
|
433
|
+
|
|
434
|
+
**Evidence.** `packages/selector/tests/estimator-channel.client.spec.tsx` mounts the section with
|
|
435
|
+
`profile: 'balanced'` and asserts the anchor still reads `Estimator (optional)`, that the notice
|
|
436
|
+
contains the current profile label and `Select TokenPilot-inspired`, and that no channel select,
|
|
437
|
+
no provider input and no `input[list]` exist. Counter-proof: substituting `null` for the notice
|
|
438
|
+
turns that case red (`expected undefined to be 'Estimator (optional)'`) while the other six stay
|
|
439
|
+
green — the guard fails against the pre-fix behaviour, so it is not vacuous.
|
|
440
|
+
|
|
441
|
+
**Affected surface.** Client bundle only: `src/client/CompressionProfileSelector.tsx`,
|
|
442
|
+
`src/client/locales.ts` (both dictionaries; `en` satisfies the full key set), `lib/client.js`,
|
|
443
|
+
`lib/client.d.ts`. No runtime, config, or persistence change, and no change to
|
|
444
|
+
`presetOptions` semantics.
|
|
445
|
+
|
|
446
|
+
**Still open.** The save affordance remains unexplained in the UI — fields commit on change or
|
|
447
|
+
blur with only a transient busy state, so "did that save?" has no answer on screen. That is a
|
|
448
|
+
separate, larger change (explicit save button plus three-state feedback) and is not fixed here.
|
|
449
|
+
|
|
450
|
+
---
|
|
451
|
+
|
|
452
|
+
## Verification ledger — `feat/ctx-preset-v2` closure
|
|
453
|
+
|
|
454
|
+
Closure = `935d501` + the root-`exports` completion (`./invariant`). The working tree held
|
|
455
|
+
exactly that one manifest change; `lib/**` rebuilt byte-identically, so the build is
|
|
456
|
+
deterministic.
|
|
457
|
+
|
|
458
|
+
### Ten gates
|
|
459
|
+
|
|
460
|
+
| # | Command | Result |
|
|
461
|
+
| --- | --- | --- |
|
|
462
|
+
| 1 | `pnpm install` | exit 0 |
|
|
463
|
+
| 2 | `pnpm build` | exit 0 |
|
|
464
|
+
| 3 | `pnpm typecheck` | exit 0 |
|
|
465
|
+
| 4 | `pnpm lint` | exit 0 |
|
|
466
|
+
| 5 | `pnpm test` | exit 1 — nondeterministic Windows set, see below |
|
|
467
|
+
| 6 | `pnpm test:built` | exit 0 |
|
|
468
|
+
| 7 | `pnpm verify:release` | exit 0 |
|
|
469
|
+
| 8 | `pnpm pack:dry-run` | exit 0 |
|
|
470
|
+
| 9 | `pnpm test:e2e:packed` (`DSH_E2E_MODE=dev`) | exit 0 |
|
|
471
|
+
| 10 | `pnpm test:e2e:packed` (release mode) | **blocked** — external precondition, see below |
|
|
472
|
+
|
|
473
|
+
### Gate 5 — the failure set is nondeterministic; do not cite it as "4 known failures"
|
|
474
|
+
|
|
475
|
+
A single `pnpm test` run is not a baseline. Eight interleaved runs (four at `455f74f`,
|
|
476
|
+
four at the closure commit), same machine, nothing else running:
|
|
477
|
+
|
|
478
|
+
| Run | `455f74f` failed | closure failed |
|
|
479
|
+
| --- | --- | --- |
|
|
480
|
+
| 1 | 3 | 5 |
|
|
481
|
+
| 2 | 3 | 2 |
|
|
482
|
+
| 3 | 4 | 3 |
|
|
483
|
+
| 4 | 3 | 4 |
|
|
484
|
+
|
|
485
|
+
A ninth run, taken while a packed-install E2E ran concurrently, reported **9** failures at
|
|
486
|
+
`455f74f` — the same commit that reported 3 in three other runs. The count tracks machine
|
|
487
|
+
load, not code.
|
|
488
|
+
|
|
489
|
+
Per test name, over the four quiet runs on each side:
|
|
490
|
+
|
|
491
|
+
| Test | `455f74f` | closure |
|
|
492
|
+
| --- | --- | --- |
|
|
493
|
+
| `preset-overlay.host.spec.ts` > uses owner-only files and starts a new generation after source content changes | 4/4 | 4/4 |
|
|
494
|
+
| `standing-generation.host.spec.ts` > keeps one fully-identical generation under concurrent composition of the same identity | 3/4 | 3/4 |
|
|
495
|
+
| `standing-generation.host.spec.ts` > keeps one generation under concurrent and repeated composition of the same identity | 3/4 | 3/4 |
|
|
496
|
+
| `standing-generation.host.spec.ts` > separates colliding equal-size generations on a whole-second metadata surface before publish | 3/4 | 3/4 |
|
|
497
|
+
| `standing-generation.host.spec.ts` > switches the standing generation for an equal-length source change at a fixed threshold | 0/4 | 1/4 |
|
|
498
|
+
|
|
499
|
+
Four of the five fail on both sides at identical frequency: pre-existing. The fifth failed
|
|
500
|
+
once in four runs on the closure side and never on the baseline side, inside the same
|
|
501
|
+
timing-sensitive `describe` block as three tests that are 3/4 flaky on *both* sides. It is
|
|
502
|
+
recorded as **not excluded**, not as clean.
|
|
503
|
+
|
|
504
|
+
The visible causes are Windows-only: an owner-only permission assertion (`0o700` against
|
|
505
|
+
`0o666`), `fs.rename` `EPERM` during publish under concurrency, and mtime-window
|
|
506
|
+
assertions that assume a coarser clock.
|
|
507
|
+
|
|
508
|
+
**Consequence for review.** Any criterion phrased as "the failure set matches the baseline
|
|
509
|
+
item by item" is unsatisfiable — the baseline has no single failure set. Compare
|
|
510
|
+
*ever-failed* sets over at least three interleaved runs per side instead.
|
|
511
|
+
|
|
512
|
+
### Gate 10 — external precondition, not a defect
|
|
513
|
+
|
|
514
|
+
Release mode needs the *published* previous release to build the upgrade leg of its
|
|
515
|
+
fixture. `0.1.0-beta.2` was never published, so the fixture aborts with `release gate
|
|
516
|
+
requires the published previous release for the upgrade leg: packument responded 404`.
|
|
517
|
+
`DSH_E2E_MODE=dev` (gate 9) is the runnable leg and passes. Blocked on publishing, not on
|
|
518
|
+
this repository.
|
|
519
|
+
|
|
520
|
+
### Criterion withdrawn
|
|
521
|
+
|
|
522
|
+
The earlier merge plan carried "the overlay identity hash is unchanged across the merge".
|
|
523
|
+
That is unsatisfiable by construction: identity is `sha256(preset.id ‖ source ‖
|
|
524
|
+
JSON.stringify({modules, autoCompactThresholdPercent}))` computed over **absolute** module
|
|
525
|
+
paths, so collapsing two packages into one necessarily changes it. The replacement is
|
|
526
|
+
structural — `canonicalCompressionRows` stays byte-identical and the only permitted
|
|
527
|
+
difference in the generated YAML is the `tool-result-pruner` row's `name` resolving to the
|
|
528
|
+
merged package.
|
|
529
|
+
|
|
530
|
+
### `invariant.ts` literal decision
|
|
531
|
+
|
|
532
|
+
The merged package keeps **one** invariant companion, and it is the runtime's: `name =
|
|
533
|
+
'context-compression-selector-runtime-invariant'`, `PACKAGE_NAME =
|
|
534
|
+
'dsh-context-compression-improved-runtime'`. Both stay verbatim.
|
|
535
|
+
|
|
536
|
+
- The string is the frozen provenance literal (inheritance rule 4) and is written into
|
|
537
|
+
durable session logs, so renaming it would discard historical tail-trim entries.
|
|
538
|
+
- The companion's real checks (`validatePublishedTailTrim`, `sessionEvents`) belong to the
|
|
539
|
+
runtime, so the runtime identity is the semantically correct one.
|
|
540
|
+
- The pre-merge `packages/selector/src/invariant.ts` companion
|
|
541
|
+
(`client-ui-context-compression-selector-invariant`, `PACKAGE_NAME =
|
|
542
|
+
'dsh-context-compression-improved'`) installed **no** checks (`install = () => {}`) and
|
|
543
|
+
was dropped by the merge. Nothing is lost: its only effect was reserving a name in the
|
|
544
|
+
invariant registry, which is keyed by the installing package either way.
|
|
545
|
+
|
|
546
|
+
---
|
|
547
|
+
|
|
548
|
+
## Affected-surface matrix
|
|
549
|
+
|
|
550
|
+
| Branch / version | D1 entry import | D2 install contract | D3 artifact chunks | D4 profile | Verdict |
|
|
551
|
+
| --- | --- | --- | --- | --- | --- |
|
|
552
|
+
| `feat/ctx-preset-v2` @ `455f74f` | **present (crash)** | partial | n/a before merge | needed | affected; D1/D2 fixed on merge branch |
|
|
553
|
+
| merged single package | eliminated | fixed (all four subpaths) | **gated** | delivered | this change |
|
|
554
|
+
| `compat/0.1.5` @ `d7c592d` | no (lazy) | **absent** | n/a | needed | **inherits the whole contract** |
|
|
555
|
+
| `ts/0.1.5` @ `refactor/ts-0.1.5-merge` | no | **fixed by the R3 replay** (root manifest is the install surface, `./pruner` + `./invariant` declared) | **gated** (shared `lib/config.js` chunk added by the replay) | needed (script delivered) | contract inherited; D7 re-checked and the route defect it masked fixed —see below |
|
|
556
|
+
| `baseline/pre-god-module-split`, `main` @ `e337bf5` | no | **absent, no `lib/`** | n/a | needed | not distributable by design |
|
|
557
|
+
| any future single-package release | structurally impossible | — | **permanent gate** | — | inherits D3 |
|
|
558
|
+
| every branch on this host | — | — | — | — | was **blocked by D6**; the profile install now completes, so real-machine verification is unblocked |
|
|
559
|
+
|
|
560
|
+
### D7 per branch — the fix must travel one way only
|
|
561
|
+
|
|
562
|
+
`asWebServer` has two different bodies across the branches, and they are not equivalent:
|
|
563
|
+
|
|
564
|
+
| Branch | `asWebServer` returns | Verdict |
|
|
565
|
+
| --- | --- | --- |
|
|
566
|
+
| `compat/0.1.5` @ `d7c592d` | `value as WebServerLike` — the service itself | **correct; never had D7** |
|
|
567
|
+
| `feat/ctx-preset-v2` @ `e588f1c`, `ts/0.1.2+` @ `0eb5183` | `{ register }` — a detached method | **carries D7** |
|
|
568
|
+
| `baseline/pre-god-module-split`, `main` @ `e337bf5` | no such helper | n/a |
|
|
569
|
+
| `ts/0.1.5` @ `refactor/ts-0.1.5-merge` | `value as WebServerLike` —the service itself | **correct; never had D7**. The helper was taken from this line, not from the V2 line |
|
|
570
|
+
|
|
571
|
+
The defect was introduced on the V2 line, not inherited from the 0.1.x line. That inverts the
|
|
572
|
+
usual direction of these hand-offs: **the 0.1.5 replay must not copy this helper out of
|
|
573
|
+
`feat/ctx-preset-v2`.** Take `compat`'s body, or the fixed one from `00afcfc`; they agree.
|
|
574
|
+
|
|
575
|
+
## `ts/0.1.5` (compat) verdicts —2026-09-15
|
|
576
|
+
|
|
577
|
+
Branch `refactor/ts-0.1.5-merge`, the R3 replay of the single-package install contract
|
|
578
|
+
(`6941d2f` merge, `e511fe8` contract specs, `165f495` route registration, `e7e927c` lint
|
|
579
|
+
paths, `66c8c63` toolchain sweep, `6f2cb51` rebuilt artifacts, `75e3327` settings schema).
|
|
580
|
+
|
|
581
|
+
| Defect | Verdict on this line |
|
|
582
|
+
| --- | --- |
|
|
583
|
+
| D1 —host entry statically imports a sibling package | **unaffected.** This line had already inlined the namespace and downgraded the settings schema to `z.any()` (`ab2175a`) to keep the entry free of cross-package imports; the replay removed the reason for both. |
|
|
584
|
+
| D2 —root manifest missing the install contract | **fixed by the replay.** The root manifest is the install surface again: `name`, `main`, `types`, `exports` (`.`, `./invariant`, `./pruner`, `./client`), `dependencies`, `dsh`. |
|
|
585
|
+
| D3 —build chunks not committed | **gated here too.** The replay reintroduced a shared chunk (`lib/config.js`, imported by both entries through the settings schema), so the artifact-graph gate was run red 鈫?green: 11 artifacts, every relative import resolves, every non-CSS artifact is inside the `files` whitelist and tracked, no `.css` entry declared. |
|
|
586
|
+
| D4 —consumer profile leftovers | **same status as the other lines**: the hygiene script is delivered, the profile side is a host precondition the operator runs. |
|
|
587
|
+
| D5 —`compat/0.1.5` predates the install contract | **this replay is the D5 action.** |
|
|
588
|
+
| D6 —profile blocks dependency reconciliation | **unchanged.** No `os error 5` in this round; the `katex` write gap is still on the books for the next subtree replacement. |
|
|
589
|
+
| D7 —estimator catalog route never registered | **the detached-method body was never here**, but the route still had a registration defect of its own: the injection gate asked for `webServer`, `llm` and `agentDefaultModel`, and an unsatisfied `ctx.inject` callback is silent, so a usable `webServer` with a late `llm` left the plugin with no HTTP API at all. Fixed by `165f495` (dual prefix, guarded two-channel registration, per-request service resolution, `console` lifecycle lines); guard `estimator-route-registration.host.spec.ts`, six cases, falsified against the old gate (4 of 6 red). |
|
|
590
|
+
| U1 —the estimator card hides itself | **present, not fixed on this line.** The 0.1.5 client still renders nothing when the profile or channel does not enable the estimator, so the block disappears without saying why. The 0.1.2 line fixed this in `bb1f496`; this replay did not carry the client change. Recorded here so it is not silently inherited —porting it is a client-side item, not part of the install contract. |
|
|
591
|
+
|
|
592
|
+
**Estimator defects as first reported (`D-1` route, `D-2` save awareness).** `D-1` is D7 above;
|
|
593
|
+
on this line it was the over-broad gate, now fixed. `D-2` (explicit save button with three-state
|
|
594
|
+
feedback) is **not implemented on either line**: this branch still commits on blur, exactly like
|
|
595
|
+
`ts/0.1.2+`, where the item was explicitly descoped once the real defect turned out to be the
|
|
596
|
+
route.
|
|
597
|
+
|
|
598
|
+
**One more defect found and fixed by the replay.** `ab2175a` downgraded the settings schema to
|
|
599
|
+
`z.any()`, and that schema was the only thing publishing the daily Custom defaults, so
|
|
600
|
+
`settings.get('context-compression')` no longer carried `custom`. It was already failing before
|
|
601
|
+
the merge: the loader E2E case `publishes the daily Custom defaults from the plugin-owned
|
|
602
|
+
settings row` and the packed install E2E both stop on `settings.custom` being undefined, and the
|
|
603
|
+
five `public-runtime` Auto Compact cases assert audits derived from the same document. `75e3327`
|
|
604
|
+
restores `ContextCompressionSettingsSchema` in both `settings.register` calls, matching the
|
|
605
|
+
0.1.2 line.
|
|
606
|
+
|
|
607
|
+
**Suite effect of this branch, same machine and command:** 22 failed / 358 passed before
|
|
608
|
+
(`d7c592d`), 1 failed / 365 passed after. The remaining failure is the Windows mtime flake in
|
|
609
|
+
`standing-generation.host.spec.ts` that the compat report already documents as environment
|
|
610
|
+
caused.
|
|
611
|
+
|
|
612
|
+
## Inheritance rules
|
|
613
|
+
|
|
614
|
+
1. **The root manifest is the install contract**: `name`, `main`, `types`, `exports`,
|
|
615
|
+
`dependencies`, `dsh` — all six. A new subpath export is declared in both the root and
|
|
616
|
+
the package manifest.
|
|
617
|
+
2. **No top-level cross-package import inside one package.** `lib/**/*.js` may only
|
|
618
|
+
reference the frozen provenance literal.
|
|
619
|
+
3. **`lib/**` ships in the same commit as its sources**, and every chunk an entry imports
|
|
620
|
+
must be committed. Enforced by `pnpm verify:release`.
|
|
621
|
+
4. **The provenance literal `dsh-context-compression-improved-runtime` is frozen.** It is
|
|
622
|
+
already written into durable session logs (`source.plugin` on tail-trim manifests) and
|
|
623
|
+
validated on read, so renaming it silently discards historical tail-trim entries. This
|
|
624
|
+
covers every occurrence, including `src/invariant.ts`'s `PACKAGE_NAME` and companion
|
|
625
|
+
`name` — the merge does **not** rename them to match the merged package name.
|
|
626
|
+
5. **Profile-side hygiene**: install spec that actually resolves, no dead `overrides`. And
|
|
627
|
+
before trusting any profile-side install result: reconcile dependencies **with the host
|
|
628
|
+
stopped**, and test a directory's write right — never its owner (D6).
|
|
629
|
+
6. **Never detach a method off a host service.** Duck typing that returns `{ register }`
|
|
630
|
+
instead of the service loses `this`, and `dsh-host-webserver.register` reads its route
|
|
631
|
+
tables off `this`. Pass the service object itself; `dsh-perm-gate` does, which is why it
|
|
632
|
+
serves its routes. The same trap applies to any service whose methods touch instance
|
|
633
|
+
state, so check the contract before narrowing a service to a single method (D7).
|
|
634
|
+
7. **A conditional the user cannot see is a defect, not a design.** If a section renders only
|
|
635
|
+
under some profile, mode, or capability, the hidden branch must say what is missing and what
|
|
636
|
+
would restore it — and keep its heading and anchor id so the panel is still findable where
|
|
637
|
+
the reader last saw it. Gating *semantics* are not what is on trial here; hiding the *reason*
|
|
638
|
+
is (U1).
|
|
639
|
+
|
|
640
|
+
## Change log
|
|
641
|
+
|
|
642
|
+
| Date | Entry | Action |
|
|
643
|
+
| --- | --- | --- |
|
|
644
|
+
| 2026-09-14 | D1–D5 | Ledger created; D1 fixed; D2 fixed for `dependencies`/`./pruner`; D3 gate added and verified; D4 delivered as a script; D5 recorded for `compat/0.1.5` |
|
|
645
|
+
| 2026-09-14 | D2 | `./invariant` added to the root `exports`; root and package manifests now agree. Ten-gate closure ledger added, with the gate-5 flakiness evidence and the withdrawn identity-hash criterion || 2026-09-15 | D2/D3 | `ts/0.1.2+` fast-forwarded onto the god-module-split branch (`04f86e4`) and pushed; the rebuild reproduces the committed `lib/` blob for blob |
|
|
646
|
+
| 2026-09-15 | D5 | `ts/0.1.5` replay: runtime merged into the selector package, root manifest made the install surface, toolchain/scripts/CI swept to one package, artifacts committed, D3 gate green |
|
|
647
|
+
| 2026-09-15 | D7 | `ts/0.1.5` route registration rewritten to the verified pattern; guard added and falsified against the old gate |
|
|
648
|
+
| 2026-09-15 | settings defaults | `z.any()` reverted to `ContextCompressionSettingsSchema` on `ts/0.1.5`; the loader E2E, the packed E2E and the five Auto Compact cases pass again || 2026-09-15 | docs | `ts/0.1.5` docs swept to the single package (four-language installation guides, selector READMEs, `THIRD_PARTY_NOTICES`, `TEST_INVENTORY`, four CHANGELOGs) |
|
|
649
|
+
| 2026-09-15 | known doc defect | `README.md`, `README.zh.md` and the three localized installation guides carry a handful of corrupted non-ASCII bytes (`0xE2` sequences) **on both lines, pre-dating this work**. The stale two-package sentences were replaced with correct text; the surrounding corruption still needs a regeneration pass from the English source. Recorded so it is not mistaken for a merge artifact |
|
|
650
|
+
| 2026-09-14 | D6 | Profile dependency-reconciliation blocker diagnosed: two independent `os error 5` sources (one ACL-denied directory; mapped native modules held by the live host), plus the ownership-vs-write-right criterion warning. Delivered as a dry-runnable script |
|
|
651
|
+
| 2026-09-15 | D6 | **Resolved.** One plain `pnpm install` in the profile converged (`+256 -16`, exit 0); the lockfile repointed itself and the `_pacquet-stage_` residue is gone. Cleared by convergence over successive attempts, not by the ACL repair — the `katex` denial stays on record |
|
|
652
|
+
| 2026-09-15 | D7 | **The estimator catalog route had never registered at all.** `asWebServer` detached `register` from the service, `this` became the wrapper, the host threw inside `register`, and a catch-all swallowed it. Fixed by passing the service itself; 200 verified on the real host; the injection, isolation and transport hypotheses recorded earlier are withdrawn |
|
|
653
|
+
| 2026-09-15 | U1 | **The estimator card was hidden by its own gate.** Off TokenPilot-inspired the section rendered `null`, so the reader saw a missing feature rather than a gated one. The heading and anchor are now kept and the hidden branch names the profile that unlocks the card; the gate itself is unchanged. Guard added with a counter-proof; the save-affordance question stays open |
|
|
654
|
+
| 2026-09-15 | doc corruption — mechanism | **Diagnosed.** A damaged spot is the 2-byte prefix of a three-byte UTF-8 character followed by `0x3F`: the character lost its third byte and, in most spots, the byte that followed it was consumed too (a double-byte-code-page decode/write pair collapse; 0 or 1 bytes lost per spot). The damage is **inherited, not produced here**: the newest valid blob of every affected file is `e337bf5`, while the same files are already defective at the `compat/0.1.5` baseline `d7c592d` and at `04f86e4`. Ten files carry it, not five — `README.{zh,ja,ko}.md` and `scripts/packed-install-e2e.mjs` were missed by the earlier note |
|
|
655
|
+
| 2026-09-15 | doc corruption — repaired | **Batch I / T-I2.** All ten files repaired by restoring each damaged spot from `e337bf5`, with three independent checks: the restored character must carry the surviving 2-byte prefix; re-corrupting the repair reproduces the previous bytes exactly (so the edit touches nothing but the damage, and no line, no EOL and no other character moves); and the repair must agree with the valid ancestor everywhere outside the restored spots. Every affected file is now valid UTF-8. The English `README.md` is the clean case: ten spots, all `—`/quote characters plus their following space, zero other differences from the ancestor |
|
|
656
|
+
| 2026-09-15 | ledger encoding | The twelve `—` characters in this file had been mangled to `鈥?` by the PowerShell port of the ledger (the 0.1.2 source has none); restored. Same class as the doc corruption above, introduced by that one-time port rather than inherited |
|
|
657
|
+
| 2026-09-19 | D8/D9 | Compression-quality defects ledgered on `feat/ctx-compression-v2-compat015`: search hits were dropped unlocatably (21.2%), HTML kept its `<head>` and lost its body; both fixed with two-tier search folding and two-stage HTML reduction, each with counter-proof tests |
|