dsh-context-compression-improved 0.11.4 → 0.13.0
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/.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 +582 -0
- package/CHANGELOG.pt.md +167 -0
- package/CHANGELOG.ru.md +554 -0
- package/CHANGELOG.zh.md +247 -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 +121 -15
- package/README.pt.md +96 -0
- 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/assets/dshfind-card.svg +33 -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/docs/shallow-teaching-preset-template.md +46 -0
- package/eslint.config.js +30 -0
- package/package.json +112 -127
- 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/{dsh.plugin.json → packages/selector/dsh.plugin.json} +2 -2
- package/{lib → packages/selector/lib}/client.js +400 -0
- package/packages/selector/lib/style.css +350 -0
- package/packages/selector/package.json +180 -0
- package/packages/selector/screenshots.json +3 -0
- package/packages/selector/src/client/CompressionProfileControls.tsx +352 -0
- package/packages/selector/src/client/CompressionProfileSelector.module.css +199 -0
- package/packages/selector/src/client/CompressionProfileSelector.tsx +89 -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 +68 -0
- package/packages/selector/src/client/fab-pos.ts +71 -0
- package/packages/selector/src/client/guide-steps.ts +50 -0
- package/packages/selector/src/client/guide.tsx +368 -0
- package/packages/selector/src/client/index.ts +456 -0
- package/packages/selector/src/client/locales/de.ts +167 -0
- package/packages/selector/src/client/locales/es.ts +167 -0
- package/packages/selector/src/client/locales/fr.ts +167 -0
- package/packages/selector/src/client/locales/it.ts +167 -0
- package/packages/selector/src/client/locales/ja.ts +167 -0
- package/packages/selector/src/client/locales/ko.ts +167 -0
- package/packages/selector/src/client/locales/pt.ts +167 -0
- package/packages/selector/src/client/locales/ru.ts +167 -0
- package/packages/selector/src/client/locales.ts +334 -0
- package/packages/selector/src/client/monitor-fab.ts +445 -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 +171 -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 +909 -0
- package/packages/selector/src/invariant.ts +113 -0
- package/packages/selector/src/preset-overlay.ts +749 -0
- package/packages/selector/src/profiles.ts +554 -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 +3222 -0
- package/packages/selector/src/runtime/adaptive-cost.ts +205 -0
- package/packages/selector/src/runtime/audit.ts +321 -0
- package/packages/selector/src/runtime/config.ts +887 -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/fold-router.ts +143 -0
- package/packages/selector/src/runtime/measurement.ts +444 -0
- package/packages/selector/src/runtime/monitor.ts +341 -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/sediment-card.ts +126 -0
- package/packages/selector/src/runtime/sediment-clock.ts +87 -0
- package/packages/selector/src/runtime/sediment-guard.ts +136 -0
- package/packages/selector/src/runtime/sediment-publish.ts +144 -0
- package/packages/selector/src/runtime/sediment-span.ts +170 -0
- package/packages/selector/src/runtime/sediment.ts +209 -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/shallow-tools.ts +342 -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 +42 -0
- package/packages/selector/src/runtime/toolclass.ts +103 -0
- package/packages/selector/src/runtime/triage/masks.ts +128 -0
- package/packages/selector/src/runtime/triage/shallow.ts +132 -0
- package/packages/selector/src/runtime/triage/signals.ts +167 -0
- package/packages/selector/src/runtime/triage/types.ts +125 -0
- package/packages/selector/src/runtime/types.ts +396 -0
- package/packages/selector/src/runtime/value.ts +48 -0
- package/packages/selector/src/settings-bridge.ts +175 -0
- package/packages/selector/src/tui-command.ts +99 -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/fixtures/sediment-pool/52adc205-cloud-5.orig.txt +231 -0
- package/packages/selector/tests/fixtures/sediment-pool/95fcba5d-cloud-25.orig.txt +236 -0
- package/packages/selector/tests/fixtures/sediment-pool/95fcba5d-cloud-38.orig.txt +220 -0
- package/packages/selector/tests/fixtures/sediment-pool/95fcba5d-cloud-42.orig.txt +140 -0
- package/packages/selector/tests/fixtures/sediment-pool/95fcba5d-cloud-53.orig.txt +117 -0
- package/packages/selector/tests/fixtures/sediment-pool/95fcba5d-local-10.orig.txt +67 -0
- package/packages/selector/tests/fixtures/sediment-pool/a7a767c0-cloud-45.orig.txt +119 -0
- package/packages/selector/tests/fixtures/sediment-pool/a7a767c0-cloud-49.orig.txt +119 -0
- package/packages/selector/tests/fixtures/sediment-pool/a7a767c0-cloud-63.orig.txt +131 -0
- package/packages/selector/tests/fixtures/sediment-pool/a7a767c0-cloud-75.orig.txt +196 -0
- package/packages/selector/tests/fixtures/sediment-pool/a7a767c0-cloud-76.orig.txt +71 -0
- package/packages/selector/tests/fixtures/sediment-pool/a7a767c0-cloud-85.orig.txt +126 -0
- package/packages/selector/tests/fixtures/sediment-pool/a7a767c0-cloud-86.orig.txt +86 -0
- package/packages/selector/tests/fixtures/sediment-pool/a7a767c0-cloud-87.orig.txt +50 -0
- package/packages/selector/tests/fixtures/sediment-pool/a7a767c0-cloud-96.orig.txt +102 -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 +91 -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/behavior-lock-profiles.spec.ts +128 -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/fallback-diversity.spec.ts +75 -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/fold-router.spec.ts +140 -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/sediment-card.spec.ts +111 -0
- package/packages/selector/tests/runtime/sediment-config.spec.ts +56 -0
- package/packages/selector/tests/runtime/sediment-guard.spec.ts +71 -0
- package/packages/selector/tests/runtime/sediment-masks.spec.ts +95 -0
- package/packages/selector/tests/runtime/sediment-orchestrator.spec.ts +166 -0
- package/packages/selector/tests/runtime/sediment-pool-share.spec.ts +65 -0
- package/packages/selector/tests/runtime/sediment-publish.spec.ts +142 -0
- package/packages/selector/tests/runtime/sediment-real-shapes.spec.ts +158 -0
- package/packages/selector/tests/runtime/sediment-settings.spec.ts +73 -0
- package/packages/selector/tests/runtime/sediment-signals.spec.ts +124 -0
- package/packages/selector/tests/runtime/sediment-span.spec.ts +92 -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/shallow-primitives.spec.ts +135 -0
- package/packages/selector/tests/runtime/sidechannel.spec.ts +241 -0
- package/packages/selector/tests/runtime/source-kind-audit.spec.ts +79 -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 +729 -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.d.mts +3 -0
- package/scripts/hosts.mjs +81 -0
- package/scripts/packed-components-smoke.mjs +763 -0
- package/scripts/packed-install-e2e.mjs +1346 -0
- package/scripts/sediment-latency-report.mjs +63 -0
- package/scripts/sync-hosts.mjs +176 -0
- package/scripts/toolclass-corpus-replay.mjs +281 -0
- package/scripts/verify-release.mjs +342 -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/{lib → packages/selector/lib}/client.d.ts +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
- /package/{locale → packages/selector/locale}/de.json +0 -0
- /package/{locale → packages/selector/locale}/en.json +0 -0
- /package/{locale → packages/selector/locale}/es.json +0 -0
- /package/{locale → packages/selector/locale}/fr.json +0 -0
- /package/{locale → packages/selector/locale}/it.json +0 -0
- /package/{locale → packages/selector/locale}/ja.json +0 -0
- /package/{locale → packages/selector/locale}/ko.json +0 -0
- /package/{locale → packages/selector/locale}/pt.json +0 -0
- /package/{locale → packages/selector/locale}/ru.json +0 -0
- /package/{locale → packages/selector/locale}/zh.json +0 -0
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto'
|
|
2
|
+
import { readdir, readFile, stat } from 'node:fs/promises'
|
|
3
|
+
import { join, relative } from 'node:path'
|
|
4
|
+
import { fileURLToPath } from 'node:url'
|
|
5
|
+
import { peerRange, selectorDshPeers, supportedHosts } from './hosts.mjs'
|
|
6
|
+
|
|
7
|
+
const root = fileURLToPath(new URL('..', import.meta.url))
|
|
8
|
+
|
|
9
|
+
const fail = (message) => {
|
|
10
|
+
throw new Error(`release verification: ${message}`)
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const json = async (path) => JSON.parse(await readFile(path, 'utf8'))
|
|
14
|
+
const rootPackage = await json(join(root, 'package.json'))
|
|
15
|
+
const selectorPackage = await json(join(root, 'packages/selector/package.json'))
|
|
16
|
+
|
|
17
|
+
if (!rootPackage.scripts?.typecheck?.includes('pnpm run typecheck:tests')
|
|
18
|
+
|| rootPackage.scripts?.['typecheck:tests'] !== 'tsc --noEmit -p tsconfig.tests.json') {
|
|
19
|
+
fail('root typecheck must include the strict active-test TypeScript gate')
|
|
20
|
+
}
|
|
21
|
+
// The root manifest is the install surface for git installs: one package
|
|
22
|
+
// carries the runtime, the settings UI and the bundle patch.
|
|
23
|
+
if (rootPackage.name !== 'dsh-context-compression-improved') fail('unexpected root package name')
|
|
24
|
+
for (const specifier of ['.', './invariant', './pruner', './client']) {
|
|
25
|
+
if (rootPackage.exports?.[specifier] === undefined) {
|
|
26
|
+
fail(`root exports are missing the ${specifier} specifier`)
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
if (rootPackage.dsh?.bundle?.patch !== './packages/selector/cordis.patch.yml') {
|
|
30
|
+
fail('root must declare the DSH Bundle patch of the selector package')
|
|
31
|
+
}
|
|
32
|
+
// The root manifest is the install surface: every bare specifier the packaged
|
|
33
|
+
// runtime files import must be provided by that install or by the Harness
|
|
34
|
+
// installation, and that split is REVIEWED here rather than assumed. 0.5.3
|
|
35
|
+
// imported `@deepseek-ai/schemastery` while neither manifest declared it, so the
|
|
36
|
+
// import resolved only while an unrelated package happened to hoist it into the
|
|
37
|
+
// profile; a clean install fell through to the installation's shared-module
|
|
38
|
+
// fallback and failed where that fallback had no built package. An import with
|
|
39
|
+
// no provider fails here instead of at a consumer's first boot.
|
|
40
|
+
const INSTALLATION_PROVIDED_RUNTIME = new Set([
|
|
41
|
+
'@deepseek-ai/cordis',
|
|
42
|
+
'@deepseek-ai/cordis-plugin-include',
|
|
43
|
+
'@deepseek-ai/dsh-commands',
|
|
44
|
+
'@deepseek-ai/dsh-llm',
|
|
45
|
+
'@deepseek-ai/dsh-session',
|
|
46
|
+
'@deepseek-ai/dsh-settings',
|
|
47
|
+
'@deepseek-ai/dsh-tools',
|
|
48
|
+
])
|
|
49
|
+
// The client-plane entry loads in the web bundler, which carries the client
|
|
50
|
+
// stack (`react`, the ui-slot packages); its requires are reviewed from the
|
|
51
|
+
// built artifact further down instead.
|
|
52
|
+
// Clean-build output set (tsdown entries + shared chunks). `lib/config.js` and
|
|
53
|
+
// `lib/host-generation.js` were stale committed artifacts of an older entry
|
|
54
|
+
// table — the current bundle no longer emits them; keep this list equal to the
|
|
55
|
+
// real `lib/*.js` set or the scan below dies on ENOENT.
|
|
56
|
+
const HOST_PLANE_ENTRIES = [
|
|
57
|
+
'lib/index.js',
|
|
58
|
+
'lib/pruner.js',
|
|
59
|
+
'lib/invariant.js',
|
|
60
|
+
'lib/tail-trim.js',
|
|
61
|
+
]
|
|
62
|
+
const RUNTIME_IMPORT = /(?:^|[^.\w])(?:import|export)\s[^;]*?from\s*['"]([^'"]+)['"]|(?:^|[^.\w])(?:import|require)\s*\(\s*['"]([^'"]+)['"]\s*\)/gmu
|
|
63
|
+
const runtimeImports = new Set()
|
|
64
|
+
for (const entry of HOST_PLANE_ENTRIES) {
|
|
65
|
+
const source = await readFile(join(root, 'packages/selector', entry), 'utf8')
|
|
66
|
+
for (const match of source.matchAll(RUNTIME_IMPORT)) {
|
|
67
|
+
const specifier = match[1] ?? match[2]
|
|
68
|
+
if (specifier.startsWith('.') || specifier.startsWith('node:')) continue
|
|
69
|
+
runtimeImports.add(specifier.split('/').slice(0, specifier.startsWith('@') ? 2 : 1).join('/'))
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
if (runtimeImports.size === 0) fail('the packaged runtime import scan found no bare specifier')
|
|
73
|
+
for (const dependency of [...runtimeImports].sort()) {
|
|
74
|
+
if (INSTALLATION_PROVIDED_RUNTIME.has(dependency)) continue
|
|
75
|
+
if (rootPackage.dependencies?.[dependency] === undefined) {
|
|
76
|
+
fail(`root dependencies are missing ${dependency}, which the packaged runtime imports`)
|
|
77
|
+
}
|
|
78
|
+
if (selectorPackage.dependencies?.[dependency] === undefined) {
|
|
79
|
+
fail(`selector dependencies are missing ${dependency}, which the packed candidate imports`)
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
for (const specifier of ['.', './invariant', './pruner', './client']) {
|
|
83
|
+
if (selectorPackage.exports?.[specifier] === undefined) {
|
|
84
|
+
fail(`selector exports are missing the ${specifier} specifier`)
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
if (selectorPackage.scripts?.test
|
|
88
|
+
!== 'vitest run --root ../.. --config vitest.config.ts --project runtime --project selector-host --project selector-client') {
|
|
89
|
+
fail('Selector package-local test script is not the verified root project command')
|
|
90
|
+
}
|
|
91
|
+
const ci = await readFile(join(root, '.github/workflows/ci.yml'), 'utf8')
|
|
92
|
+
for (const required of [
|
|
93
|
+
'pnpm --filter dsh-context-compression-improved test',
|
|
94
|
+
]) {
|
|
95
|
+
if (!ci.includes(required)) fail(`CI lacks package-local gate: ${required}`)
|
|
96
|
+
}
|
|
97
|
+
// The packed release E2E is the release gate that actually installs the
|
|
98
|
+
// tarballs: verify it cannot be silently dropped or defanged. It must exist
|
|
99
|
+
// as a root script, CI must run exactly that script, the script must default
|
|
100
|
+
// to fail-closed release mode, and that mode must refuse every skip/null
|
|
101
|
+
// lifecycle outcome.
|
|
102
|
+
if (rootPackage.scripts?.['test:e2e:packed'] !== 'node scripts/packed-install-e2e.mjs') {
|
|
103
|
+
fail('root test:e2e:packed script is missing or does not run the packed E2E directly')
|
|
104
|
+
}
|
|
105
|
+
if (!ci.includes('pnpm run test:e2e:packed') && !ci.includes('pnpm test:e2e:packed')) {
|
|
106
|
+
fail('CI does not run the packed release E2E gate')
|
|
107
|
+
}
|
|
108
|
+
const packedE2e = await readFile(join(root, 'scripts/packed-install-e2e.mjs'), 'utf8')
|
|
109
|
+
if (!/const e2eMode = process\.env\.DSH_E2E_MODE === 'dev' \? 'dev' : 'release'/u.test(packedE2e)) {
|
|
110
|
+
fail('packed E2E must default to release mode (dev only via an explicit DSH_E2E_MODE)')
|
|
111
|
+
}
|
|
112
|
+
for (const failClosed of [
|
|
113
|
+
'release gate requires the upgrade leg to run',
|
|
114
|
+
'release gate requires the official clean-harness lifecycle to run',
|
|
115
|
+
]) {
|
|
116
|
+
if (!packedE2e.includes(failClosed)) {
|
|
117
|
+
fail(`packed E2E release mode lost its fail-closed guard: ${failClosed}`)
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
const packedComponents = await readFile(join(root, 'scripts/packed-components-smoke.mjs'), 'utf8')
|
|
121
|
+
for (const required of [
|
|
122
|
+
'Runtime.measureForCompaction(visionCtx, visionImage)',
|
|
123
|
+
"estimatedImageCount?.kind === 'tokenizer-estimate'",
|
|
124
|
+
'estimatedImageCount.tokens === 340',
|
|
125
|
+
'estimatedImageCount.upperBoundTokens === 384',
|
|
126
|
+
'imageMeasurement.currentSurface.kind',
|
|
127
|
+
]) {
|
|
128
|
+
if (!packedComponents.includes(required)) {
|
|
129
|
+
fail(`packed component smoke lost its installed vision estimate guard: ${required}`)
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
for (const required of [
|
|
133
|
+
"packedVisionSmoke.imageSession?.measurement?.kind === 'tokenizer-estimate'",
|
|
134
|
+
'packedVisionSmoke.imageSession.measurement.tokens === 340',
|
|
135
|
+
'packedVisionSmoke.imageSession.measurement.upperBoundTokens === 384',
|
|
136
|
+
'packedVisionSmoke.imageSession.measurement.estimatorId',
|
|
137
|
+
'packedVisionSmoke.imageSession.measurement.estimatorRevision',
|
|
138
|
+
]) {
|
|
139
|
+
if (!packedE2e.includes(required)) {
|
|
140
|
+
fail(`packed E2E lost its parsed vision estimate guard: ${required}`)
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
await stat(join(root, 'tsconfig.tests.json'))
|
|
144
|
+
|
|
145
|
+
if (selectorPackage.dsh?.bundle?.patch !== './cordis.patch.yml') {
|
|
146
|
+
fail('selector must declare the DSH Bundle patch')
|
|
147
|
+
}
|
|
148
|
+
if (selectorPackage.files?.some((entry) => entry.endsWith('.css'))) {
|
|
149
|
+
fail('selector must not rely on separately served CSS assets')
|
|
150
|
+
}
|
|
151
|
+
if (selectorPackage.name !== 'dsh-context-compression-improved') fail('unexpected selector package name')
|
|
152
|
+
if (selectorPackage.publishConfig?.access !== 'public') fail('selector publish access is not public')
|
|
153
|
+
if (selectorPackage.publishConfig?.tag !== 'latest') fail('selector publish tag is not latest')
|
|
154
|
+
// engines 统一后:selector 与 root 同走 hosts.mjs 的 `peerRange`(`>=<floor> <0.3.0-0`)。
|
|
155
|
+
// 逐 rc 枚举 `hostCells` 只供 README / 矩阵脚本展示,不再下发给 engines 或 peer
|
|
156
|
+
// (见 hosts.mjs 注释)。所以门禁不再数枚举长度(那是统一前的旧形状),
|
|
157
|
+
// 改钉两件事:engines.dsh 必须等于单源 peerRange;每个 dsh-* peer 必须与 engines 全等。
|
|
158
|
+
for (const peer of selectorDshPeers) {
|
|
159
|
+
if (selectorPackage.peerDependencies?.[peer] !== selectorPackage.engines?.dsh) {
|
|
160
|
+
fail(`selector peer ${peer} must equal engines.dsh (the single-source peerRange)`)
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
if (selectorPackage.engines?.dsh !== peerRange) {
|
|
164
|
+
fail(`selector engines.dsh must equal hosts.mjs peerRange (${peerRange}); supportedHosts=${supportedHosts.length} 条枚举已不再下发`)
|
|
165
|
+
}
|
|
166
|
+
// v0.10.5 起 root 用区间;engines 统一后 selector 也用同一条区间,两侧口径一致。
|
|
167
|
+
if (!/^>=\S+ <\S+$/.test(String(rootPackage.engines?.dsh ?? ''))) {
|
|
168
|
+
fail('root engines.dsh must carry the install-surface range (">=lower <upper"), per the 0.10.5 range switch')
|
|
169
|
+
}
|
|
170
|
+
for (const peer of Object.keys(rootPackage.peerDependencies ?? {})) {
|
|
171
|
+
if (rootPackage.peerDependencies[peer] !== rootPackage.engines.dsh) {
|
|
172
|
+
fail(`root peer ${peer} must equal the install-surface enum`)
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
const packageRoot = join(root, 'packages/selector')
|
|
176
|
+
const notice = await readFile(join(packageRoot, 'THIRD_PARTY_NOTICES.md'), 'utf8')
|
|
177
|
+
if (!notice.includes('Copyright (c) 2026 DeepSeek')) {
|
|
178
|
+
fail('packages/selector does not carry the full DeepSeek Harness MIT notice')
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
const assetManifests = [
|
|
182
|
+
{
|
|
183
|
+
directory: 'deepseek-v4',
|
|
184
|
+
repository: 'deepseek-ai/DeepSeek-V4-Pro',
|
|
185
|
+
modelIds: 'deepseek-v4-flash","deepseek-v4-pro',
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
directory: 'deepseek-v4-vision-exp',
|
|
189
|
+
repository: 'deepseek-ai/DeepSeek-V4-Flash-Vision-Exp',
|
|
190
|
+
revision: '6821d6ad3681a4b137b066b76094fa82ebd0a380',
|
|
191
|
+
modelIds: 'deepseek-v4-flash-vision-exp',
|
|
192
|
+
},
|
|
193
|
+
]
|
|
194
|
+
for (const expected of assetManifests) {
|
|
195
|
+
const assetRoot = join(root, 'packages/selector/assets', expected.directory)
|
|
196
|
+
const manifest = await json(join(assetRoot, 'manifest.json'))
|
|
197
|
+
if (manifest.repository !== expected.repository) fail(`${expected.directory} manifest repository differs`)
|
|
198
|
+
if (!JSON.stringify(manifest.modelIds).includes(expected.modelIds)) {
|
|
199
|
+
fail(`${expected.directory} manifest model ids differ`)
|
|
200
|
+
}
|
|
201
|
+
if (expected.revision !== undefined && manifest.revision !== expected.revision) {
|
|
202
|
+
fail(`${expected.directory} manifest revision is not the pinned vision revision`)
|
|
203
|
+
}
|
|
204
|
+
for (const [name, descriptor] of Object.entries(manifest.files)) {
|
|
205
|
+
const bytes = await readFile(join(assetRoot, name))
|
|
206
|
+
const hash = createHash('sha256').update(bytes).digest('hex')
|
|
207
|
+
if (bytes.byteLength !== descriptor.bytes) fail(`${expected.directory}/${name} byte length differs from manifest`)
|
|
208
|
+
if (hash !== descriptor.sha256) fail(`${expected.directory}/${name} SHA-256 differs from manifest`)
|
|
209
|
+
// A checkout with core.autocrlf=true can rewrite these pinned bytes as CRLF;
|
|
210
|
+
// the `-text` attribute in .gitattributes prevents it, but only while the
|
|
211
|
+
// pattern still matches the path. Catch it here rather than in a consumer
|
|
212
|
+
// whose tokenizer would fail its own integrity check at run time.
|
|
213
|
+
if (bytes.includes(0x0d)) fail(`${expected.directory}/${name} contains CR bytes; the asset was rewritten`)
|
|
214
|
+
}
|
|
215
|
+
const assetEntries = selectorPackage.files ?? []
|
|
216
|
+
if (!assetEntries.some(entry => entry === 'assets' || entry.startsWith('assets/'))) {
|
|
217
|
+
fail('selector package files list omits the tokenizer assets')
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
const sourceRoots = [join(root, 'packages/selector/src')]
|
|
222
|
+
const forbidden = [
|
|
223
|
+
{ pattern: /compaction\/group-trim/u, label: 'custom compaction/group-trim event' },
|
|
224
|
+
{ pattern: /@deepseek-ai\/[^'"\s]+\/src(?:\/|['"])/u, label: 'Harness source subpath import' },
|
|
225
|
+
{ pattern: /(?:\/home\/|[A-Za-z]:\\Users\\)/u, label: 'developer absolute path' },
|
|
226
|
+
{ pattern: /\.\.\/\.\.\/\.\.\/(?:core|packages)\//u, label: 'monorepo-relative source import' },
|
|
227
|
+
// The single-package merge must not leave a cross-package import behind.
|
|
228
|
+
{ pattern: /from\s*['"]dsh-context-compression-improved-runtime/u, label: 'cross-package runtime import' },
|
|
229
|
+
]
|
|
230
|
+
|
|
231
|
+
const walk = async (directory) => {
|
|
232
|
+
const entries = await readdir(directory, { withFileTypes: true })
|
|
233
|
+
const files = []
|
|
234
|
+
for (const entry of entries) {
|
|
235
|
+
const path = join(directory, entry.name)
|
|
236
|
+
if (entry.isDirectory()) files.push(...await walk(path))
|
|
237
|
+
else files.push(path)
|
|
238
|
+
}
|
|
239
|
+
return files
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
for (const sourceRoot of sourceRoots) {
|
|
243
|
+
for (const path of await walk(sourceRoot)) {
|
|
244
|
+
const text = await readFile(path, 'utf8')
|
|
245
|
+
for (const rule of forbidden) {
|
|
246
|
+
if (rule.pattern.test(text)) fail(`${relative(root, path)} contains ${rule.label}`)
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
const lib = join(packageRoot, 'lib')
|
|
252
|
+
if (!(await stat(lib)).isDirectory()) fail(`${relative(root, lib)} is missing; run build first`)
|
|
253
|
+
for (const path of await walk(lib)) {
|
|
254
|
+
if (path.endsWith('.map')) fail(`${relative(root, path)} is a source map`)
|
|
255
|
+
if (path.endsWith('.js')) {
|
|
256
|
+
const text = await readFile(path, 'utf8')
|
|
257
|
+
if (/from\s*["']dsh-context-compression-improved-runtime["']/u.test(text)) {
|
|
258
|
+
fail(`${relative(root, path)} still imports the removed runtime package`)
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
const clientArtifact = await readFile(join(root, 'packages/selector/lib/client.js'), 'utf8')
|
|
264
|
+
if (!clientArtifact.startsWith('window.__ModuleLoader__.load({')) {
|
|
265
|
+
fail('client.js is not a Harness lazy-CJS artifact')
|
|
266
|
+
}
|
|
267
|
+
if (!clientArtifact.includes('data-plugin-css') || !clientArtifact.includes('document.head.appendChild(tag)')) {
|
|
268
|
+
fail('client.js does not contain its tagged CSS injection')
|
|
269
|
+
}
|
|
270
|
+
if (/^\s*(?:import|export)\s/mu.test(clientArtifact)) fail('client.js contains ESM syntax')
|
|
271
|
+
if (/(?:\/home\/|[A-Za-z]:\\Users\\)/u.test(clientArtifact)) fail('client.js contains a developer absolute path')
|
|
272
|
+
if (clientArtifact.includes('sourceMappingURL')) fail('client.js contains a source map reference')
|
|
273
|
+
const clientRequires = [...clientArtifact.matchAll(/require\("([^"]+)"\)/gu)].map(match => match[1])
|
|
274
|
+
const allowedClientRequires = new Set([
|
|
275
|
+
'react',
|
|
276
|
+
'react/jsx-runtime',
|
|
277
|
+
'@deepseek-ai/dsh-client-ui-primitives',
|
|
278
|
+
])
|
|
279
|
+
for (const dependency of clientRequires) {
|
|
280
|
+
if (!allowedClientRequires.has(dependency)) fail(`client.js has unexpected external dependency ${dependency}`)
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
const collectSpecs = async (directory) => (await walk(directory))
|
|
284
|
+
.filter(path => /\.spec\.tsx?$/u.test(path))
|
|
285
|
+
.map(path => relative(root, path).replaceAll('\\', '/'))
|
|
286
|
+
.sort()
|
|
287
|
+
|
|
288
|
+
const runtimeSpecs = await collectSpecs(join(root, 'packages/selector/tests/runtime'))
|
|
289
|
+
const compatSpecs = await collectSpecs(join(root, 'packages/selector/tests/compat'))
|
|
290
|
+
const selectorSpecs = (await collectSpecs(join(root, 'packages/selector/tests')))
|
|
291
|
+
.filter(path => !path.startsWith('packages/selector/tests/runtime/')
|
|
292
|
+
&& !path.startsWith('packages/selector/tests/compat/'))
|
|
293
|
+
if (runtimeSpecs.some(path => !path.endsWith('.spec.ts'))) {
|
|
294
|
+
fail('Runtime test inventory contains a spec outside the active **/*.spec.ts project')
|
|
295
|
+
}
|
|
296
|
+
// compat-legacy: the narrow-waist specs run inside the runtime project (node env).
|
|
297
|
+
if (compatSpecs.some(path => !path.endsWith('.spec.ts'))) {
|
|
298
|
+
fail('Compat test inventory contains a spec outside the active **/*.spec.ts project')
|
|
299
|
+
}
|
|
300
|
+
const selectorUnclassified = selectorSpecs.filter(path => path !== 'packages/selector/tests/cache-prefix-audit.spec.ts'
|
|
301
|
+
&& path !== 'packages/selector/tests/estimator-catalog.spec.ts'
|
|
302
|
+
&& path !== 'packages/selector/tests/built/client-artifact.spec.ts'
|
|
303
|
+
&& !path.endsWith('.host.spec.ts')
|
|
304
|
+
&& !path.endsWith('.client.spec.ts')
|
|
305
|
+
&& !path.endsWith('.client.spec.tsx'))
|
|
306
|
+
if (selectorUnclassified.length > 0) {
|
|
307
|
+
fail(`Selector test inventory contains unclassified specs: ${selectorUnclassified.join(', ')}`)
|
|
308
|
+
}
|
|
309
|
+
const rootTestConfig = await readFile(join(root, 'vitest.config.ts'), 'utf8')
|
|
310
|
+
for (const required of [
|
|
311
|
+
'packages/selector/tests/runtime/**/*.spec.ts',
|
|
312
|
+
'packages/selector/tests/compat/**/*.spec.ts',
|
|
313
|
+
'packages/selector/tests/**/*.host.spec.ts',
|
|
314
|
+
'packages/selector/tests/**/*.client.spec.{ts,tsx}',
|
|
315
|
+
'packages/selector/tests/cache-prefix-audit.spec.ts',
|
|
316
|
+
]) {
|
|
317
|
+
if (!rootTestConfig.includes(required)) fail(`vitest.config.ts lacks active inventory rule ${required}`)
|
|
318
|
+
}
|
|
319
|
+
const builtTestConfig = await readFile(join(root, 'vitest.built.config.ts'), 'utf8')
|
|
320
|
+
if (!builtTestConfig.includes('packages/selector/tests/built/**/*.spec.ts')) {
|
|
321
|
+
fail('vitest.built.config.ts lacks the built client artifact inventory rule')
|
|
322
|
+
}
|
|
323
|
+
const forbiddenTestDependencies = [
|
|
324
|
+
/(?:from\s+|import\s*\(|require\s*\()\s*['"]@deepseek-ai\/dsh-compaction-tool-result-pruner/u,
|
|
325
|
+
/(?:from\s+|import\s*\(|require\s*\()\s*['"]@deepseek-ai\/dsh-tool-context-retrieve/u,
|
|
326
|
+
/\.\.\/\.\.\/\.\.\/(?:core|client)\//u,
|
|
327
|
+
]
|
|
328
|
+
for (const path of [...runtimeSpecs, ...selectorSpecs]) {
|
|
329
|
+
const text = await readFile(join(root, path), 'utf8')
|
|
330
|
+
if (forbiddenTestDependencies.some(pattern => pattern.test(text))) {
|
|
331
|
+
fail(`${path} depends on a removed core-extension or monorepo test contract`)
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
const runtime = await import(new URL('../packages/selector/lib/pruner.js', import.meta.url))
|
|
336
|
+
const defaults = runtime.DEFAULT_CUSTOM_COMPRESSION_POLICY
|
|
337
|
+
if (defaults?.history?.trigger !== 500_000) fail('Custom History default is not 500000')
|
|
338
|
+
if (defaults?.tailTrim?.trigger !== 700_000 || defaults?.tailTrim?.enabled !== false) {
|
|
339
|
+
fail('Custom TailTrim default is not disabled at 700000')
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
console.info('release verification: OK')
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Test inventory
|
|
2
|
+
|
|
3
|
+
Every checked-in spec belongs to an active test project. There is no silent
|
|
4
|
+
legacy-test allowlist.
|
|
5
|
+
|
|
6
|
+
## Root suite
|
|
7
|
+
|
|
8
|
+
- Runtime: `packages/selector/tests/runtime/**/*.spec.ts` under the `runtime` project.
|
|
9
|
+
- Selector Host: `cache-prefix-audit.spec.ts` plus every `*.host.spec.ts` under
|
|
10
|
+
the `selector-host` project.
|
|
11
|
+
- Selector client: every `*.client.spec.ts` or `*.client.spec.tsx` under the
|
|
12
|
+
`selector-client` project.
|
|
13
|
+
- Built browser artifact: `packages/selector/tests/built/client-artifact.spec.ts`
|
|
14
|
+
under the separate `vitest.built.config.ts` gate, after `pnpm build`.
|
|
15
|
+
|
|
16
|
+
The root `pnpm test`, both package-local `pnpm test` commands, and
|
|
17
|
+
`pnpm test:built` are release gates. `scripts/verify-release.mjs` compares the
|
|
18
|
+
checked-in spec inventory with these project rules so a new test cannot be
|
|
19
|
+
silently excluded.
|
|
20
|
+
|
|
21
|
+
## Removed transition tests
|
|
22
|
+
|
|
23
|
+
The standalone extraction initially carried twelve specs copied from the
|
|
24
|
+
integrated Harness worktree. They depended on removed private packages,
|
|
25
|
+
monorepo-relative fixtures, or the retired `compaction/group-trim` event and
|
|
26
|
+
were not executable in a public checkout. They were removed instead of
|
|
27
|
+
reintroducing Harness core dependencies.
|
|
28
|
+
|
|
29
|
+
Their supported behavior is covered by active public tests:
|
|
30
|
+
|
|
31
|
+
- policy resolution, reducers, exact measurement, Fresh, Aggregate, routine
|
|
32
|
+
and capacity-pressure History, Native pruning, TailTrim publication,
|
|
33
|
+
recovery, replay and orphan fail-open behavior:
|
|
34
|
+
`packages/selector/tests/runtime/public/public-runtime.spec.ts`;
|
|
35
|
+
- Loader composition, preset overlay, Minimal pause/restore and parent/child
|
|
36
|
+
service identity: `packages/selector/tests/preset-overlay-loader.e2e.host.spec.ts`;
|
|
37
|
+
- package/export/tarball contract:
|
|
38
|
+
`packages/selector/tests/public/package-contract.client.spec.ts` and
|
|
39
|
+
`scripts/packed-install-e2e.mjs`;
|
|
40
|
+
- profile and Custom editor behavior:
|
|
41
|
+
`packages/selector/tests/profiles.client.spec.tsx`.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2023",
|
|
4
|
+
"module": "ESNext",
|
|
5
|
+
"moduleResolution": "Bundler",
|
|
6
|
+
"lib": ["ES2023", "DOM", "DOM.Iterable"],
|
|
7
|
+
"strict": true,
|
|
8
|
+
"noUncheckedIndexedAccess": true,
|
|
9
|
+
"exactOptionalPropertyTypes": true,
|
|
10
|
+
"verbatimModuleSyntax": true,
|
|
11
|
+
"isolatedModules": true,
|
|
12
|
+
"allowImportingTsExtensions": true,
|
|
13
|
+
"skipLibCheck": true,
|
|
14
|
+
"resolveJsonModule": true,
|
|
15
|
+
"jsx": "react-jsx",
|
|
16
|
+
"types": ["node", "vitest/globals"]
|
|
17
|
+
}
|
|
18
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "./tsconfig.base.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"noEmit": true,
|
|
5
|
+
"composite": false
|
|
6
|
+
},
|
|
7
|
+
"include": [
|
|
8
|
+
"packages/selector/src/**/*.ts",
|
|
9
|
+
"packages/selector/src/**/*.tsx",
|
|
10
|
+
"packages/selector/tests/**/*.ts",
|
|
11
|
+
"packages/selector/tests/**/*.tsx",
|
|
12
|
+
"vitest.config.ts",
|
|
13
|
+
"vitest.built.config.ts"
|
|
14
|
+
]
|
|
15
|
+
}
|
package/vitest.config.ts
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { defineConfig } from 'vitest/config'
|
|
2
|
+
import { fileURLToPath } from 'node:url'
|
|
3
|
+
import { tmpdir } from 'node:os'
|
|
4
|
+
import { join } from 'node:path'
|
|
5
|
+
|
|
6
|
+
// apply() 会把统计持久层(StatsStore)开在 resolveDshHome() 下;host spec
|
|
7
|
+
// 调 apply 时把 DSH_HOME 钉到临时目录,测试绝不写真实 ~/.dsh。
|
|
8
|
+
const VITEST_DSH_HOME = join(tmpdir(), 'cci-vitest-dsh-home')
|
|
9
|
+
|
|
10
|
+
export default defineConfig({
|
|
11
|
+
test: {
|
|
12
|
+
passWithNoTests: false,
|
|
13
|
+
projects: [
|
|
14
|
+
{
|
|
15
|
+
test: {
|
|
16
|
+
name: 'runtime',
|
|
17
|
+
environment: 'node',
|
|
18
|
+
env: { DSH_HOME: VITEST_DSH_HOME },
|
|
19
|
+
include: [
|
|
20
|
+
'packages/selector/tests/runtime/**/*.spec.ts',
|
|
21
|
+
'packages/selector/tests/compat/**/*.spec.ts',
|
|
22
|
+
],
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
test: {
|
|
27
|
+
name: 'selector-host',
|
|
28
|
+
environment: 'node',
|
|
29
|
+
env: { DSH_HOME: VITEST_DSH_HOME },
|
|
30
|
+
include: [
|
|
31
|
+
'packages/selector/tests/cache-prefix-audit.spec.ts',
|
|
32
|
+
'packages/selector/tests/estimator-catalog.spec.ts',
|
|
33
|
+
'packages/selector/tests/**/*.host.spec.ts',
|
|
34
|
+
],
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
resolve: {
|
|
39
|
+
alias: {
|
|
40
|
+
'@deepseek-ai/dsh-client-ui-primitives': fileURLToPath(new URL(
|
|
41
|
+
'./packages/selector/tests/support/ui-primitives.tsx',
|
|
42
|
+
import.meta.url,
|
|
43
|
+
)),
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
test: {
|
|
47
|
+
name: 'selector-client',
|
|
48
|
+
environment: 'jsdom',
|
|
49
|
+
include: ['packages/selector/tests/**/*.client.spec.{ts,tsx}'],
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
},
|
|
54
|
+
})
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|