dsh-verify-cheap: Verify changes at minimal cost

Preface

When modifying code in DSH, agents typically either run full test suites or use fixed sleep commands to wait for build or dev processes to be ready. The former is time-consuming, while the latter often results in unnecessary waiting or remains unstable. Common practice relies on experience to select check items and on rough estimates to report duration, making it difficult to accumulate knowledge across sessions regarding whether “this level is sufficient” or “if the cost can be further reduced.”

Here we introduce the community plugin dsh-verify-cheap (Maintainer: Ushio155, Category: Workflow). It installs a skill named verify-cheap into the harness and comes with two zero-dependency Node scripts designed to: select the cheapest check that yields a definitive conclusion based on a cost ladder, replace fixed delays with conditional polling, and replace verbal estimates with measured durations.

What is this

dsh-verify-cheap is an installable DSH plugin containing only one skill: verify changes at the lowest cost. Upon installation, it uses cordis.patch.yml to register the package’s skills/ as a skill root, integrating the skill into the agent’s skill directory. The skill body and the description (trigger surface) in SKILL.md are in Chinese; the bundled scripts are language-agnostic and can be used independently of DSH.

Skill Coverage

The skill documentation breaks down verification into executable rules, primarily including:

  1. Cost Ladder L0–L3: Static checks / Probes / Single test suites / Full suites. Includes typical durations and applicable scenarios for each, as well as guidance on selecting a level based on whether the change is to “behavior” or “presentation.”
  2. Do not use fixed delays for background jobs: Use conditional polling + timeouts. Fixed delays should only be considered if three specific conditions listed in the documentation are met; otherwise, it amounts to guessing.
  3. Assertions must be capable of failing: An assertion for which no failure scenario can be imagined is equivalent to having no verification. Prioritize asserting specific values rather than checking for “existence,” “non-empty,” or “less than N.”
  4. Duration must be measured: The script prints a segmented duration table, providing both the external total time and the internal script timing. If there is a significant discrepancy between the two, it suggests that handles, connections, or timers might be keeping the event loop alive.
  5. Accumulate pitfalls for the next session: Facts that cannot be derived by reading the code should be written into the repository’s long-term index (e.g., merged into a “Cost Table” section if SUMMARY.md exists), rather than just being written in the README or session notes.
  6. When not to use / Skip levels directly: If changes affect public code or build configurations → go directly to L3; for exploratory debugging, clarify the problem before selecting a level; for security, concurrency, or timing-related changes where static check confidence is low, start from L2.
  7. Cost table placement: Record three items for each verification (Level / Measured Duration / Whether it can be lowered one level). The table is stored in .verify-cost.md at the repository root.

Reference materials are located in skills/verify-cheap/references/: anti-patterns.md, cost-measurement.md, probe-cookbook.md.

Installation and Activation

The installation command comes from the repository README (note the --profile web and GitHub casing):

dsh plugin --profile web add github:Ushio155/dsh-verify-cheap

The plugin points to cordis.patch.yml via dsh.bundle.patch in package.json. It inserts @deepseek-ai/dsh-skill-filesystem and uses customSkillDirs to point to this package’s skills/. The providerName must be unique per package, and includeDefaultRoots should be false to avoid naming conflicts with the harness’s built-in provider.

It is recommended to review the source code and the MIT license before installation. The plugin runs with the current dsh process permissions, and tool calls triggered by the skill are executed under the same permissions.

Two Zero-Dependency Scripts (Node >= 18)

The two scripts utilize only node: built-in modules and do not rely on third-party packages. They are responsible for waiting and timing; the command you pass to them is what gets executed.

wait-until.mjs: Conditional Polling + Timeout

Replaces fixed sleep commands in scripts: it re-evaluates the condition on every attempt, returns immediately upon satisfaction, and exits with failure on timeout.

node skills/verify-cheap/scripts/wait-until.mjs --timeout 120 -- npm run build
node skills/verify-cheap/scripts/wait-until.mjs --timeout 90 --file out/index.js
node skills/verify-cheap/scripts/wait-until.mjs --timeout 30 --port 3080
node skills/verify-cheap/scripts/wait-until.mjs --timeout 120 --match "listening on" -- npm run dev

Can also be imported as a library waitUntil. Exit codes: 0 Condition met / 1 Timeout / 2 Argument error. Note that --match requires capturing the subprocess’s stdout and is unavailable in restricted sandboxes that prohibit piped stdio.

measure-runtime.mjs: Measured Duration

CLI Mode measures the external total duration of any command (from subprocess startup to exit), passing through the subprocess exit code; returns 127 if the process cannot be started:

node skills/verify-cheap/scripts/measure-runtime.mjs --label "L2 Integration Tests" -- npm test
node skills/verify-cheap/scripts/measure-runtime.mjs --json -- pwsh -File build.ps1

Library Mode provides segmented timing and an internal vs. external comparison: it prints a segmented table based on [Sections], marking the difference between the external total time and the internal script timing, which facilitates writing to .verify-cost.md or generating reports.

Typical Usage (Combined with the Skill)

  1. Select a level from L0–L3 based on the type of change (the README suggests going directly to L3 if public code or build configurations are touched, without needing an initial L0 probe).
  2. When waiting for builds, files, ports, or log keywords, use wait-until.mjs for polling instead of hardcoding delays.
  3. When running checks, use measure-runtime.mjs to record the level and measured duration, and determine if it can be lowered one level.
  4. Write results to .verify-cost.md in the repository root to facilitate reuse in subsequent sessions.

Applicable Scenarios and Notes

Suitable for: Teams or individuals who wish to unify a “cheapest but definitive” verification strategy within agent workflows, require reusable polling and timing tools, and want to maintain a long-term verification cost table within their projects.

Notes:

  • The plugin declares peerDependencies as "*" for @deepseek-ai/cordis and @deepseek-ai/dsh-skill-filesystem. The README explains the tested background regarding pre-release harness versions and semver ranges. If the skill does not appear after installation, refer to the cordis.patch.yml path resolution method in the README (using createRequire to locate the package directory, rather than mistakenly using new URL('skills/', baseUrl)).
  • research/trigger-ab/ is an archive for description trigger experiments, not included in the npm package files content, and is irrelevant to daily usage.
  • The community directory SkillHub is an independent site and has no official affiliation with DeepSeek / High-Flyer. Metadata such as star counts are subject to the directory page.

Conclusion

dsh-verify-cheap consolidates “level selection, polling, measurement, and table logging” into a single verify-cheap skill and two independently runnable scripts. It is suitable as a DSH workflow plugin to reduce the default cost of the verification phase. For further information, visit the SkillHub Directory Page and the GitHub Repository.

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

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

Xiaoye