Introduction

In DSH long sessions, dialogue content and tool results continuously accumulate, increasing pressure on the context window. dsh-argp is a third-party context compression engine for DeepSeek Harness (dsh): instead of allowing the model to freely rewrite history, it asks the model to make extract, summary, or false decisions on “atoms,” which are then evaluated by a deterministic guard to decide if the proposal should be applied. Compressed and pruned content is retained in an append-only log, allowing for subsequent recall.

Below is an introduction to its core mechanism, installation method, typical configuration, and usage notes.

What is this

dsh-argp is maintained by yoza10635 under the MIT license.

It solves the problem of needing to control context size while avoiding the loss of original historical text when rewritten. dsh-argp works in three parts:

  • Stage-1 Atoms compression: The model proposes compression candidates, and the guard evaluates whether to apply them.
  • Stage-2 Citation graph pruning: When thresholds are exceeded, whole atoms are removed according to graph rules; this stage performs 0 LLM calls during compression.
  • append-only log: Holds the original text of compressed and pruned content, supporting two-level recall.

Core Mechanism

Stage-1 Atoms Compression

Stage-1 proposes compression for the atoms of the current turn.

The model can make three types of decisions on atoms:

extract
summary
false

The deterministic guard is responsible for judging whether these proposals can be applied. In other words, the LLM only proposes candidate results; whether they are actually replaced is decided by the guard.

Stage-2 Citation Graph Pruning

Stage-2 removes whole atoms in reverse topological order when thresholds are exceeded. This stage performs 0 LLM calls during compression.

CiteDeclarer declares cross-turn citation edges every round and makes them available to Stage-2 via the injectEdges channel.

Log and Recall

The append-only log holds the original text of compressed and pruned content.

RecallZoom provides two levels of recall:

recall_summary
recall_detail

There are also specific recalls for pruned atoms:

recall_pruned
list_pruned

Installation and Activation

First, add the plugin:

dsh plugin --profile <name> add dsh-argp

This step mounts dsh-argp to the specified profile.

Next, disable the stock summarizer in the profile’s cordis.patch.yml:

- id: compaction-basic
  disabled: true

After the above steps, the profile layer only needs to perform configuration overrides.

Mounting is handled by the package’s bundle patch; do not repeat the insert loader entry in the profile layer, otherwise a duplicate loader entry id error may occur.

Typical Configuration

If you want to explicitly specify the model backend, you can configure the llm for compressor and declarer:

- id: dsh-argp
  config:
    compressor:
      llm: { provider: deepseek-official, model: deepseek-v4-flash }
    declarer:
      llm: { provider: deepseek-official, model: deepseek-v4-flash }

When llm is not configured, OpenAI-compatible direct connection can be used based on endpoint/apiKey configuration or environment variables.

Verification Commands

The repository provides several types of runnable verification entry points.

Run per-atom soak:

npm run spike36

Run single-transaction zero LLM call verification:

npm run spike8a

Generate per-atom compression/pruning details:

node spike/atom-audit.mjs <产物目录>

Applicable Scenarios and Notes

Suitable for dsh plugin scenarios that need to control long-session context while preserving recallable original historical text.

Note the following points before use:

  • The plugin runs with the current dsh process permissions; check the source code and license before installation.
  • The benefits of Stage-1 depend on the model’s instruction following capability; the guard ensures safety, but compression benefits will vary with the model’s compliance rate.
  • The compliance rate for multi-model division in the lite tier has not been tested.
  • The compression calls in Stage-1 per round are side-channel costs; they do not enter the context but are counted in total cost.
  • B-6 window truncation blind spot: Live nodes not replaced by dsh-argp may have the oldest parts cut off by the request assembly layer when approaching contextWindow, leaving no trace, so recall_pruned may not be retrieved.
  • Tombstone two-hop recall: After the placeholder text evolves over multiple rounds, the original sequence may be lost, and recall_pruned(seq) needs correct numbering.
  • For DeepSeek series models, when system prompts conflict with user instructions, the cites declaration may be 0; Stage-1 guard compression and Stage-2 deterministic pruning still work as usual.

References

GitHub repository:

https://github.com/yoza10635/dsh-argp

The community directory is an independent site with no official affiliation to DeepSeek / Huafan; the specific directory page URL for dsh-argp was not confirmed in this material, so no link is provided here.