dsh-evidence-pages: Preserving Source Citations in Long Tool Outputs for DSH

Preface

After DeepSeek Harness compresses long tool outputs, fine-grained details from the original text are often lost. For example, a failing test case name buried in the middle of a ten-thousand-character log will no longer appear in the compressed summary. This plugin selects relevant segments locally based on rules and preserves verbatim citations, allowing the Agent to read back the original text by position after compression.

What It Is

dsh-evidence-pages is a DSH workflow plugin that, by default, selects pages locally using rule-based logic without requiring any external service. It retains fragments of the original text during compaction and generates references pointing back to the raw log, enabling the Agent to continue accessing the original content from within the compressed summary.

Maintainer: DASHAN-0079

Core Features

Local Rule-Based Page Selection

The plugin defaults to the rule strategy, which selects one page of the original text based on the combined lexical overlap between the user request, the most recent goal before compaction, and the tool name/parameters, along with error or identifier cues. Page selection is performed locally.

External Service Page Selection (Optional)

The jevos strategy delegates the same candidates to System One’s choice interface, allowing Jevos to directly select one page. You must configure a working System One service yourself.

Experimental Control Strategies

The pointer / glm strategies respectively retain only the original text address, or use the host-configured model to select a page, intended for experimental comparisons.

Citation Format

The compressed summary will contain references similar to [evidence_page seq=5 charOffset=5376]. The Agent can invoke evidence_page with that reference within the same session. The first line of the response contains the current position, total length, and next-page position, followed by the original text. Offsets are calculated in Unicode code points, and the page header also counts toward the read budget.

Installation and Enabling

The validated combination is DeepSeek Harness 0.2.2-rc.5, headless profile, Node.js ≥24.9.

Run the following commands from the source directory. The package ships ready-to-run JavaScript and requires no build step.

git clone --branch v0.3.0 https://github.com/DASHAN-0079/dsh-evidence-pages.git
cd dsh-evidence-pages
npm pack
dsh plugin --profile headless add ./dsh-evidence-pages-0.3.0.tgz
dsh --profile headless --patch ./preset/headless.patch.yml --dump-config

In the output, look for evidence-page-compaction, evidence-page-pruner, and evidence-page-reader. All three should be enabled, and the original compaction-basic and tool-result-pruner should carry disabled: true.

Then start an actual session with the same patch:

dsh --profile headless --patch ./preset/headless.patch.yml "Run the project tests and preserve the failing case name"

The package only registers the plugin. The --patch flag above is what activates it for that particular launch. When starting from a different directory, pass the absolute path to the patch. For daily use, you can add this flag to your own launch command.

If your profile already has a third-party compactor, verify which component manages these two services to avoid enabling two implementations simultaneously. Web / Desktop or SuperAgent Agent presets may have independent scopes; this release was validated against headless.

Verifying That Both Compaction and Read-Back Work

After compaction is actually triggered, a successful page-selection compaction/summary event will record provider=dsh-evidence-pages and model=rule. The summary body will contain a reference similar to [evidence_page seq=5 charOffset=5376]; use the actual values returned in your current session.

Have the Agent invoke evidence_page with that reference in the same session. The first line of the response contains the current position, total length, and next-page position, followed by the original text. Offsets are calculated in Unicode code points, and the page header also counts toward the read budget. Raw events are saved alongside the session log; once the log is deleted, the references become invalid.

If you want to reproduce the release acceptance test in a clean environment, you can run the following in this repository:

npm ci
npm test
node verify/headless.mjs "/absolute/path/to/dsh/lib/bin.js" ./dsh-evidence-pages-0.3.0.tgz

The first argument is the CLI entry point of the installed @deepseek-ai/dsh package. The script creates a temporary DSH home, installs the package you just built, feeds a long test log containing Chinese text and emoji into the real host’s pruner and compactor, and then reads back FAIL CASE_8317 from the replayed session using the registered tool. Finally, it uninstalls the plugin and diffs the native configuration. The acceptance-dedicated patch swaps the headless conversation runner for a deterministic log sample; the pruner, compactor, and read-back tool all come from the installed profile. The script explicitly triggers compaction and requires no model configuration. The 0.3.0 acceptance record shows model=rule, seq=5, charOffset=5376, and the post-uninstall configuration matches the pre-install state.

Strategies and Data Flow

Strategy Purpose
rule (default) Selects one page of the original text based on the combined lexical overlap between the user request, the most recent goal before compaction, and the tool name/parameters, along with error or identifier cues. Selection is performed locally.
jevos (optional) Delegates the same candidates to System One’s choice interface, allowing Jevos to directly select one page.
pointer / glm Experimental controls: respectively retains only the original text address, or uses the host-configured model to select a page.

Each long tool result lists at most 12 candidates, each segment up to 256 code points, and exactly one is selected. The rules do not guarantee hitting the correct segment, and there is no fixed total token budget for the entire session. When the content contains images, the original events cannot be aligned, page selection fails, or the compaction benefit is insufficient, it falls back to DSH’s native summarization, which may invoke the host-configured model.

Enabling Jevos

To enable Jevos, first configure a working System One service yourself. Set DSH_EVIDENCE_POLICY=jevos in the terminal where you launch DSH. The default address is http://127.0.0.1:18017/v1/systemone and the default model is jevos-v5. You can override these with DSH_EVIDENCE_JEV_URL, DSH_EVIDENCE_JEV_MODEL, and DSH_EVIDENCE_JEV_KEY. The service will receive the candidate original text, the user goal known at compaction time, and tool-call metadata. Only point it to an endpoint that is authorized to receive this data. To revert, remove the policy environment variable or explicitly set it to rule, then restart DSH.

Uninstall

Exit the DSH process that has the plugin enabled, and remove --patch ./preset/headless.patch.yml from your launch command. If you previously merged the patch into the profile manually, revert those lines and restore the original compactor and pruner settings.

Run:

dsh plugin --profile headless remove dsh-evidence-pages
dsh --profile headless --dump-config

Confirm that the native compaction-basic and tool-result-pruner are enabled and that the three evidence-page-* services are gone. The reference text in old summaries will still be present, but invoking evidence_page will require re-enabling the plugin.

Source and License

Split out from the plugins directory of the SuperAgent rc.5 adaptation repo. Maintained as a standalone version starting from 0.3.0. Licensed under the MIT License.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye