dsh-dream-rsi: Replay-driven Exploration Strategy Experiments in DeepSeek Harness

Preface

When building coding agents in DeepSeek Harness (DSH), a common practice is to fix a single exploration order or tune parameters manually, making it hard to systematically compare “which branch should be expanded first this round, and how the strategy should be revised next round.” Approaches such as Dream-RSI emphasize starting from the already-generated discovery tree, using replay to evaluate strategies, and then revising parameters to form a closed loop. To try such a workflow in Harness, a plugin is needed to connect the agent, tools, and state directory.

Below is an introduction to the community plugin dsh-dream-rsi (maintainer CharlesXu-HQ, categorized as workflow on SkillHub): it registers a coding agent and a strategy-revision agent in DSH, and executes one round of the experiment loop — “copy candidate → explore and evaluate → freeze tree → prefix-only replay → revise strategy → promote strategy” — through the tool dream_rsi_cycle. It is a standalone TypeScript / Cordis plugin, does not depend on Pi, and does not require DGX Spark, but still depends on an already-installed DeepSeek Harness.

What Is This

  • Repository: CharlesXu-HQ/dsh-dream-rsi
  • Catalog page: SkillHub plugin page
  • Version (package.json): 0.1.0, MIT license; the README marks it as an unofficial community implementation, not representing DeepSeek or the authors of the Dream-RSI paper.
  • Positioning: Experimental replay-based exploration-policy plugin for DeepSeek Harness — uses replay to compare strategies on historical discovery trees, and constrainedly revises linear-ranking-style strategy parameters, rather than fully reproducing arbitrary executable strategy code from the paper.

Each call to dream_rsi_cycle executes one loop: copy a candidate from the seed workspace → the agent explores and a fixed evaluator scores it → freeze the discovery tree → perform prefix-only replay on all historical trees → the agent revises strategy parameters → the strategy with the highest average replay score is used for the next round. The current strategy also participates in the comparison, so replay scores on the already-recorded historical trees will not decrease — this is not a performance guarantee on new tasks.

Core Features

The plugin creates a fixed coding agent and a strategy-revision agent through ctx.agents, and exposes dream_rsi_cycle through ctx.tools.

  1. Online exploration: the strategy agent only sees the already-generated nodes; legal parent nodes are the root or the current leaves, with at most maxWidth candidates per round. Workspaces are copied from the parent snapshot, and candidates in the same round can run in parallel.
  2. Prefix-only replay: starts from the prefix containing only the root; a leaf opens its unique historical child node, and the root opens the earliest historical child node not yet revealed. This phase does not call the coding agent or the evaluator. The score is bestScore - beta1 × N + beta2 × N / max(1, rounds).
  3. Strategy revision: currently a constrained linear-ranking program parameter set (root/score/depth/age weights, batch size, stall rounds, etc.), used to verify the “improving the exploration strategy” closed loop; it cannot express complex strategy structures.
  4. State persistence: stateDir/state.json saves the world pool and the current strategy; each cycle-* directory saves the root and child-node workspaces. stateDir must be separated from seedDir and must not contain each other.

Installation and Activation

Requires Node.js 22.19+ and an installed DeepSeek Harness CLI. The repository declares dsh.bundle and cordis.patch.yml, and can be loaded into the Web profile as a plugin wrapper. In the plugin source root directory, run the build, tests, and add it to the Web profile:

npm install
npm test
dsh plugin --profile web add .
dsh --profile web --dump-config

Once a standalone package is published, you can use dsh plugin --profile web add dsh-dream-rsi; it has not yet been published to npm.

After installation, configure the target workspace and the fixed evaluator in a task patch, replacing /ABS/PATH with a real absolute path:

- id: dream-rsi
  config:
    seedDir: '/ABS/PATH/dsh-dream-rsi/examples/toy/seed'
    stateDir: '/ABS/PATH/dsh-dream-rsi/.dream-rsi-state'
    taskPrompt: 'Edit candidate.json so value approaches 42.'
    evaluatorCommand:
      - node
      - '/ABS/PATH/dsh-dream-rsi/examples/toy/evaluate.mjs'
    provider: deepseek
    model: deepseek-chat
    maxRounds: 5
    replayRounds: 10
    maxWidth: 2
    revisions: 2
    beta1: 0.01
    beta2: 0.01

Run:

dsh web --patch /ABS/PATH/my-task.patch.yml

In the session, ask the agent to call dream_rsi_cycle. The plugin can be loaded without a task configured, but calling the tool will report missing configuration. The selected profile must also have the file-editing tools required by the coding agent and the model credentials.

Evaluator contract: the command runs under the candidate workspace, with the last argument being the absolute path to that workspace; it must output JSON from stdout, e.g. {"score": 0.8, "feedback": "tests passed"}. The evaluator is fixed and cannot be rewritten by the strategy agent.

Quality checks: npm test covers the online tree, prefix-only replay, illegal actions, and strategy-promotion semantics; npm run check performs type checking. The example can be run standalone with node examples/toy/evaluate.mjs examples/toy/seed to verify.

Typical Usage

With the configuration above, the typical path in one Web session is: launch dsh web with the patch → ask the agent in the conversation to call dream_rsi_cycle → the plugin writes to stateDir and the cycle-* workspaces per round → it promotes a strategy according to the replay results and proceeds to the next loop (bounded by configuration constraints such as maxRounds and replayRounds).

The toy example’s seedDir and evaluate.mjs are under examples/toy in the repository, suitable for first verifying that the evaluator and paths are correct, before switching to your own seed directory and evaluation command.

Use Cases and Notes

Suitable for: researchers or integration developers already running a coding agent under the DSH Web profile who want to experiment with the “discovery tree + replay scoring + strategy parameter revision” workflow; scenarios requiring a reproducible stateDir and a fixed evaluator.

Boundaries and Risks (from the README):

  • There is no paper domain adaptation, original hyperparameters/prompts, external holdout evaluation, or large-scale experimental results yet; it does not claim to reproduce the gains from the paper.
  • evaluatorCommand runs on the host machine, and the plugin does not provide a security sandbox. It should only be used in trusted workspaces, with trusted evaluation commands, and in an isolated Harness environment; do not directly eval or load model-generated strategy code into the host process.
  • Before installing the plugin, it is recommended to read the source code and the MIT license; the plugin runs with the permissions of the current dsh process. SkillHub is a community directory site with no official affiliation with DeepSeek / High-Flyer.

Conclusion

dsh-dream-rsi connects the “explore — freeze — replay — revise strategy” loop from the Dream-RSI idea to DSH’s agent and tool surfaces, making it suitable for verifying the closed loop on controllable toy or your own tasks, before deciding whether to expand the evaluator and the strategy parameter space. For further release and session verification steps, see docs/release.md in the repository.

  • Catalog page: https://www.skillhub.cn/plugins/CharlesXu-HQ/dsh-dream-rsi
  • GitHub: https://github.com/CharlesXu-HQ/dsh-dream-rsi
羽毛球分组比赛记分
小程序二维码

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

Xiaoye