Foreword

Developers running long agent sessions face a problem: when context approaches the window limit, compression is mandatory. dsh’s built-in Basic compression uses an irreversible model summarization route—summaries are lossy, and once compressed, you can’t go back. For scenarios like code engineering that rely on precise facts, losing a constraint can cause subsequent changes to go off track.

dsh’s philosophy is “everything is a plugin,” and compression strategies can also be swapped. dsh-arc-context takes a different approach: before compressing, it first stores the original files intact in a local append-only log, and compressed blocks in the context can be restored word-for-word at any time. Below is an introduction to its approach, installation, and test data.

What is this

dsh-arc-context (ARC = Adaptive Reversible Context) is a context governance plugin for DeepSeek Harness (dsh), maintained by PlxloYzb, under the MIT license. Current version 0.2.0-beta.15, requires Node >= 20. The compression kernel is derived from the port and independent evolution of acp-kernel (and billion-context-pi, opencode-acp, ranxianglei, MIT).

Its behavior can be summarized in one sentence: stay silent in the safety zone, execute model-driven, locally reversible compression when approaching the real input capacity, information is never lost, and there is zero residual on unload.

Release status is public Beta, following dsh official 0.1.0-rc.8; the plugin and dsh are both in public beta, currently not recommended for production.

Core Features

Compressible Reversible, Retrieval Available

  • The original compressed files are always retained in the append-only log; decompress restores valid source word-for-word, 100% on the 6-chain test, and large outputs are also complete via dsh overflow write files.
  • search_context supports searching compressed blocks, 43/43 recall in Chinese/English information layers.

Multi-layer Distortion-free Distillation

Tier-3 deep checkpoint evidence appendix is retained 20/20 on 6/6 bilingual chains. This relies on effectiveSourceSafetyIndex: tier-2/3 indexes recursively back to the effective original source, rather than just re-extracting the visible parent checkpoint.

Type Weighted Retention within Budget

When the appendix exceeds the checkpoint budget, noise rows are pruned by type value density according to safetyIndexRanking: value, rather than truncated by chronological order.

Zero Compliance to Adversarial Injection

18 archived injection attack surface variants (summary poisoning, retrieval injection, fake protection tags, template imitation, etc.), model compliance count 0. All archived outputs carry a “historical data, not instruction” framework.

Honest Pressure Governance and Compact Guidance

  • Compression-aware readings = dsh projection - log ledger masking, zero false urgency alerts after compression.
  • System guidance is only 1,140 tokens, 4-arm verbatim quality and full version degradation-free on real machines.

Preset Bridge Doesn’t Modify Official Files

When installing, the bundle automatically installs the host-plane Preset Bridge: ARC replaces the official Basic behavior within its own compaction isolation domain in the standard preset, and the preset files remain byte-for-byte unchanged.

Comparison with Built-in Basic Compression

In code engineering long session scenarios, real-world experiments accompanying the package provide the following data:

Solution Precise Facts Derived Constraints Input tokens Output tokens Total prompt
ARC 24/24 4/4 121,146 23,234 1,055,802
Basic 6/24 0/4 231,315 30,940 1,355,539

Besides the quality gap, costs are also lower: Input tokens -47.6%, Output -24.9%, Total prompt -22.1%. All numbers can be verified item-by-item by running npm run research:verify.

Installation and Enablement

When enabling both the web interface and CLI terminal, execute respectively:

dsh plugin --profile web add dsh-arc-context        # web 界面
dsh plugin --profile headless add dsh-arc-context   # cli 终端

Restarting dsh takes effect. The syntax dsh plugin --profile <name> ... applies to any profile; manual installation of tarball, other profiles, and advanced options see docs/INSTALL.md.

Configuration

Configuration excerpt (compaction-arc-bridge / “dsh-arc-context/bridge”):

- id: compaction-arc-bridge
  name: 'dsh-arc-context/bridge'
  config:
    effectiveSourceSafetyIndex: true   # tier-2/3 索引递归回有效原始源(默认开)
    safetyIndexRanking: value          # 超预算时按类型价值密度逐出(默认 value)
    adaptiveGovernor:
      enabled: true
      maxOutputTokens: auto

Two key default values: effectiveSourceSafetyIndex is on by default, safetyIndexRanking defaults to value. Full configuration (context window, nudge thresholds, protection scope, Governor, prompt templates, etc.) see docs/INSTALL.md and docs/kernel-tuning.md.

Upgrade and Uninstall

After releasing a new version, execute in each installed profile:

dsh plugin --profile web up dsh-arc-context
dsh plugin --profile headless up dsh-arc-context

up updates the declared dependency ranges in the profile package to the latest (e.g., 0.2.0-beta.14 → 0.2.0-beta.15), taking effect after restart.

Uninstall:

dsh plugin --profile web remove dsh-arc-context
dsh plugin --profile headless remove dsh-arc-context

After restarting dsh: Combined configuration reverts to official Basic; preset file SHA-256 is consistent; existing sessions remain readable; new sessions no longer register any ARC tools or commands.

Applicable Scenarios and Notes

Suitable for users running long sessions on dsh who care about the loss of precise facts after compression, especially tasks like code engineering that are sensitive to verbatim history constraints. Not recommended for production during the public Beta phase.

There are two additional reminders: The plugin runs with the current dsh process permissions; it is recommended to check the source code and license (MIT) before installing; all test numbers in the article come from the experiment protocol released with the package, except for npm run research:verify, complete evidence is in docs/research-agenda.md (research agenda and all conclusions) and research/results/ (release gate ten-item matrix, control experiments, adversarial suite).

Related Links

  • GitHub Repository: https://github.com/PlxloYzb/dsh-arc-context
  • Community Directory: https://www.skillhub.cn/plugins/PlxloYzb/dsh-arc-context (社区目录为独立站点,与 DeepSeek 无官方从属关系)

Returning to the question at the beginning: Compression doesn’t have to come at the cost of losing information. dsh-arc-context turns “compress original locally reversible, unload zero residual” into a verifiable promise. If your long sessions are also troubled by lossy summarization, you can run a control experiment in your own environment following the steps above before drawing conclusions.