dsh-web
zhu1090093659/dsh-webDeepSeek Harness(DSH)Web 插件聚合生态包 · 一切皆插件,创意工坊分发(dsh-market.com)
DSH 上下文压缩保真层:跨语言保真指纹、项目架构回查锚点、350K 默认压缩线,MIT 协议。 | DSH context-compaction fidelity layer: cross-lingual fingerprints, architecture retrieval, 350K default line, MIT.
Project and package name:
dsh-compaction-fidelity; positioning: bilingual DSH compaction backend with fidelity diagnostics.
A Profile Bundle for the 0.2.0-rc.2 DeepSeek Harness runtime bundled by community DSH Desktop 2.0.17. It combines a bilingual compaction engine, deterministic fidelity fingerprints and compensation, project architecture retrieval anchors, and a dynamic compaction line. See the 0.3.1 release status and the paired evaluation protocol for verified version, distribution, validation, and evaluation-design status.
Treat a compaction summary as a lossy index rather than a complete transcript.
Official compaction keeps the session running. This plugin keeps key facts, behavior constraints, and project architecture alive across that boundary.
DSH Desktop users with long sessions, large or multi-module repositories, Chinese or bilingual workflows, and tool-heavy context growth.
See REFERENCES.md for the projects and research that informed this work, SECURITY.md for the security model, and CHANGELOG.md for release notes. Project code is MIT licensed.
256K / 350K / 512K / 800K (official default) presets and custom 256 < value < 800 (K) in the composer next to the model/reasoning selector; Plugin default is 350K; 800K is capped to the official 80% window line on a 1M window. 350K is the maintainer personal comfort setting after reviewing DeepSeek V4.1 Flash auto-compaction-line projects; users may override it with a custom valid value. K means 1000 tokens, matching the DSH ContextMeter display..dsh/compaction-fidelity/ project index: module map, architecture-level files, commands, schema/migration anchors..dsh/compaction-fidelity/anchors.md and injected into the next step.compaction-fidelity-brief and compaction-fidelity-lookup retrieve exact project structure after compaction.status / refresh commands, persistent scope registry, context-compaction priority collection, Git + content-hash change detection, weighted semantic score, and append-only updates whose latest entry is last; architecture writes use a cross-process lock + CAS + atomic rename./compaction-fidelity on|off switches the whole plugin at runtime.architecture include <scope> <glob> and architecture exclude <scope> <glob> store include/exclude filters in .dsh/compaction-fidelity/architecture-scopes.json; filtered scopes drive generated docs, baselines, change detection, and anchor injection.architecture status and architecture verify report mismatches.architecture check <scope> reports aligned/stale, semantic score, detection method, attestation revision, and consistency.npm run migrate:fingerprint-privacy (dry run by default; add -- --apply to back up first)..dsh/compaction-fidelity/architecture-reminders.json.injectionMaxTokens, default 16000). Low-priority project briefs, anchors, architecture docs, and refresh hints are dropped or shortened first; when truncation happens, the prompt records <compaction_fidelity_injection_budget> and the engine logs the affected blocks.fidelity_compensation block for missing exact values, and writes metrics to .dsh/compaction-fidelity/fingerprints/.auto follows the session language (no double translation); en writes model prose in English but preserves verbatim user input and exact values..dsh/compaction-fidelity/fidelity-calibration.json; each sample records dominantLanguage, mixedRatio, cjkRatio, and latinRatio. Mixed sessions use a mixed:<dominant> group. Calibrated levels appear after 8 samples for a group; the diagnostic gate uses raw recall metrics and final probe/constraint checks, independently of historical percentiles.fidelity-calibration.json is the evidence asset. Inspect current data and import validated samples from a JSON file inside the workspace:
/compaction-fidelity calibration summary
/compaction-fidelity calibration import trusted-samples.json
The import requires samples[] with ISO timestamps, language/group keys, and rawScore/finalScore in [0,1]; it rejects invalid or oversized files, deduplicates identical samples, records the workspace-relative source, and keeps the latest 500 samples. It will not overwrite a damaged calibration store. A minimal valid source:
{
"samples": [
{ "at": "2026-10-06T00:00:00.000Z", "language": "zh", "calibrationKey": "zh", "rawScore": 0.68, "finalScore": 0.84 },
{ "at": "2026-10-06T00:01:00.000Z", "language": "en", "calibrationKey": "mixed:en", "mixedRatio": 0.42, "rawScore": 0.61, "finalScore": 0.71 }
]
}
The dashboard shows group counts and score percentiles. A calibrated level is available after 8 samples in a group; the diagnostic gate uses fixed recall thresholds and probe/constraint checks, independently of historical percentiles. Mixed groups never contribute to pure-language percentiles.
This package does override summarize() in its BasicCompactionEngine subclass. It generates a bilingual summary, compares raw and compensated summaries, and records fidelity metrics. It is therefore a compaction backend with an observability layer, not a passive observer. Another backend such as dsh-compaction-pro also occupies the compaction service/row; simultaneous backend composition has not been validated and must not be assumed safe.
Selection- or verbatim-based compaction keeps the text it chooses; it does not tell you how many exact values or CJK bigrams the generated summary failed to retain. This project records per-language retention metrics for each compaction (raw summary vs final summary after compensation), stores that record under .dsh/compaction-fidelity/, and only after 8 samples per language group uses it to report a calibrated level. The gate remains deterministic while the data accumulates.
mixed:<dominant> group so they do not silently pollute pure zh/en statistics.<compaction_fidelity_injection_budget> and the engine logs which blocks were dropped or shortened.On DSH Desktop 2.0.17 (bundled runtime 0.2.0-rc.2), install the v0.3.1 GitHub tag or a local checkout through the Desktop terminal/plugin manager. 0.3.1 is the current hardening release; the npm publication target is dsh-compaction-fidelity@0.3.1, and the Desktop community marketplace one-click path becomes available only after npm latest resolves to that stable version. Check npm view dsh-compaction-fidelity version before using the marketplace path. This repository is not yet listed in awesome-dsh-plugin.
Desktop CLI profile:
dsh plugin --profile desktop add 'github:TLNing260310/dsh-compaction-fidelity#v0.3.1'
dsh plugin --profile desktop remove dsh-compaction-fidelity
For a separate CLI Web profile, replace desktop with web. The bundle patch inserts the host plugin row and overrides the built-in preset-standard, preset-cordis, preset-ptc, and preset-minimal compaction rows (inserting a group for minimal) with dsh-compaction-fidelity/engine. New sessions use the patched presets; running sessions keep their composed tree.
The bundled preset patch already adds a compaction group to minimal. Separately, an optional, manual, host-modifying script patches the installed DSH token meter for CJK estimates and can restore its backup. It is not run by installation and is not required for the bundle to load. Test it only against the 0.2.0-rc.2 runtime in DSH Desktop 2.0.17; after any DSH update, re-check compatibility before using it:
node scripts/patch-dsh-runtime.mjs
node scripts/patch-dsh-runtime.mjs --restore # optional rollback
The script also edits the installed minimal preset and writes backups under %USERPROFILE%\.dsh\runtime-fixes\backups. This host modification is outside the marketplace bundle contract; the long-term fix belongs in an upstream token-meter extension or fix.
/compaction-fidelity status
/compaction-fidelity on | off
/compaction-fidelity threshold 256k | 350k | 512k | 800k | <tokens>
/compaction-fidelity retain <tokens>
/compaction-fidelity language auto | zh | en | bilingual
/compaction-fidelity calibration summary | import <workspace-relative-file.json>
/compaction-fidelity init | reindex
/compaction-fidelity verify
/compaction-fidelity brief
/compaction-fidelity anchors <file>
/compaction-fidelity lookup <query>
/compaction-fidelity purge --yes
/compaction-fidelity architecture check | read | create | refresh | status | verify | update | include | exclude | manage | unmanage [scope] [summary|pattern]
Tools: compaction-fidelity-brief, compaction-fidelity-lookup, compaction-fidelity-architecture.
Persistent Git-versioned artifacts, local-first scanning, module/architecture cognition, schema/migration anchors, baseline/verify freshness, stable text formats (project.meta.txt, project.code.txt, project.arch.txt, project.database.txt).
The 188K-line Go governance engine, the stdio MCP server and its 9 MCP tools, the full FRAS/Attestation/Ledger/Recovery state machine, agent-written semantic Whole-Index, live database introspection, and a full tree-sitter call graph. See README.zh.md and THIRD-PARTY-NOTICES.md for details.
Explicitly not ported or not planned:
index / observe / exclude: include / exclude is implemented; observe remains out of scope.phase_transition inference: only semantic_threshold, context_compaction, and explicit architecture commands trigger cognition refresh..env or secret files.node --test test/*.test.mjs
npm run check
node scripts/generate-preset-patch.mjs
MIT License. Upstream AOCI-CODE notices live in THIRD-PARTY-NOTICES.md and licenses/AOCI-FSL-1.1-MIT.txt.
Plugin SemVer is independent from the adapted Harness version. Harness compatibility is declared by the exact @deepseek-ai/dsh peer dependency.
0.3.1@deepseek-ai/dsh@0.2.0-rc.2 (community DSH Desktop 2.0.17)<harness-version>.plugin.<n>, for example 0.2.0-rc.2.plugin.1.25CHANGELOG.md; do not encode the Harness version in the plugin versionThe official DSH 0.2.0 compaction instruction forces English prose for cross-model canonical form, token efficiency around English code/identifiers, and prompt consistency. For Chinese sessions, however, it forces a double translation and lets the summarizer paraphrase user constraints. This plugin keeps an official-compatible fallback but adds auto (session-language checkpoint, zero translation), en (English prose with verbatim user input and an exact-value ledger), and bilingual. Compaction-Fidelity localization supports the same principle: locale changes regenerate natural-language fields but never translate paths, identifiers, APIs, or code facts.
project.txt Root Manifest with #Volume: declarationsproject.meta.txt locale/ID/quota/admission conventionscode:<path> identities and Compaction-Fidelity-MOD/ARCH/DB-#### IDsCREATE TABLE, Prisma model)project.txt / PROJECT.md instead of trusting the summary(0, 1M]; 0 and values above 1,048,576 are rejectedretainTokens must be lower than the thresholdqueueIndex auto-builds only when the index is missing; /compaction-fidelity reindex forces a rebuildindexDir and baseline.json paths are validated against traversal and symlinksThe evaluation report did not include URLs/DOIs; cite latest versions.
Legacy fingerprint migration defaults to dry-run. Apply creates an exclusive backup inside the workspace; backups retain private text and must not be shared. It detects nested final-fidelity raw values and rejects linked paths, hard links, and reused backup directories. It leaves the calibration store untouched. See the paired evaluation protocol for the pending basic/pro/fidelity comparison. The current fidelity gate reports diagnostics; it does not block compaction.