Introduction

DeepSeek Harness (DSH) agents often modify code during development but easily overlook updating related documentation in sync. The dsh-doc-impact plugin uses deterministic execution mechanisms to bind code changes to documentation updates, build a declarative impact graph, and ensure that documentation remains consistent with code.

Core Features

The plugin addresses the disconnect between documentation and code through the following mechanisms:
* Impact Analysis: Links code and documentation to a declarative impact graph.
* Change Detection: Compares the workspace against a baseline (Git or file system).
* Rule Matching: Matches incremental changes against project rules.
* Intelligent Guidance: Guides the agent to review or update affected documentation before closing the turn.
* Standard Extension: Implemented as a standard Cordis extension without requiring changes to the DSH core.

Installation and Activation

The profile parameter is required when installing the plugin in Harness. After installation, restart Harness to load the plugin.

# 从本地路径安装
dsh plugin --profile web add link:/path/to/dsh-doc-impact

# 或安装已发布的版本
dsh plugin --profile web add dsh-doc-impact

Configuration

Create the configuration file .dsh/doc-impact.yml in the workspace root directory.

version: 1

defaults:
  mode: remind
  scope: turn
  changeDetection: auto

rules:
  - id: auth-docs
    description: Authentication behavior documentation
    code:
      include:
        - packages/auth/**
        - packages/server/src/auth/**
      exclude:
        - "**/*.test.ts"
    docs:
      - docs/authentication.md
    direction: code-to-docs
    relation: documents
    mode: require-resolution

The configuration file defines the mapping relationship between code and documentation. For example, a change to packages/auth/src/session.ts triggers an update check for docs/authentication.md.

Workflow

The plugin performs the following steps within the agent’s execution flow:
1. Record Baseline: At the start of a turn, record HEAD and the hash values of all dirty files (Git mode) or the files matching selectors (file system mode).
2. End-of-Turn Check: At the end of a turn, compare the workspace against the baseline and match incremental changes.
3. Auto-Resolution: Automatically resolve impacts when the target files have already been updated.
4. Guidance and Resolution: For unresolved impacts, the plugin prompts the agent. In strict mode, the agent must call the doc_impact_resolve command to confirm.

Commands and Tools

The plugin provides a set of commands for querying and resolving documentation impact issues.

Command Purpose
/doc-impact View the current pending/resolved status
/doc-impact check Recalculate impacts immediately
/doc-impact explain <ruleId> Show details for a specific rule
/doc-impact changed List files that the plugin attributes to the agent
doc_impact_resolve Strict resolution tool; requires ruleId, status, and reason

Plugin Configuration UI

The plugin provides a browser-based configuration interface. In Harness, navigate to Settings → Plugins → Plugin Configuration to find the “Doc Impact” card.
* Staged Editing: Changes are not saved immediately; click Save to save them.
* Status Feedback: The title bar displays an unsaved badge when a draft exists.
* Reset Function: A Reset button is provided below each field to restore it to the configuration-level setting.

Important Notes

  • Repository Status: The original repository has been archived and set to read-only. Development has moved to the xarleyn/dsh-plugins monorepo.
  • New Package Name: The old package dsh-doc-impact has been replaced by @yadsh/dsh-doc-impact.
  • Dependency Requirement: Node.js >= 20 is required.
  • License: MIT License.

Conclusion

By integrating documentation impact into DSH’s automated workflow, dsh-doc-impact gives developers more deterministic assurance of code and documentation synchronization.