返回目录
模型与 MCP 插件

dsh-r-workbench

HougeLangley/dsh-r-workbench

DeepSeek Harness plugin for R data acquisition, cleaning, value gating, statistical analysis, and reporting.

Stars
0
Forks
0
Issues
0
更新
9 天前

PROJECT TOPICS

项目标签

INSTALL REFERENCE

安装参考

未验证
dsh plugin --profile web add github:HougeLangley/dsh-r-workbench

该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。

PROJECT README

README

dsh-r-workbench

A DeepSeek Harness bundle that turns the local R toolchain into six model-facing tools: acquisition, cleaning, a data-value gate, statistical analysis, reporting, and an R console.

The gate is the product: when the cleaned data cannot support a meaningful analysis, r_assess returns STOP and the analysis/report stages refuse to run. See docs/DETAIL.md for the user-facing behavior and rules.

Install

dsh plugin --profile web add github:HougeLangley/dsh-r-workbench

Then call r_env first. The plugin needs a local R installation; r_env reports missing packages and prints the exact Rscript r/install-deps.R command. RStudio and Quarto are optional and detected when present.

Layout

index.js              Host plugin: six tools, run-directory lifecycle, R subprocess runner
r/common.R            Shared R helpers (JSON I/O, hashing, HTML/Markdown, fonts, stage wrapper)
r/env.R               Toolchain inspection
r/ingest.R            Readers + cleaning
r/assess.R            Six-dimension value gate
r/analyze.R           Tests, effect sizes, BH correction, tables, charts
r/report.R            HTML/Markdown/Quarto/DOCX composition
r/run.R               Ad-hoc R console
r/install-deps.R      User-library installer for required/optional packages
cordis.patch.yml      Bundle patch (inserts the `r-workbench` row)
locale/{en,zh}.json   Plugin Manager metadata
assets/icon-180.png   Raster icon for storefronts

Stage contract

index.js invokes Rscript --vanilla r/<stage>.R <config.json> with the run directory as cwd. The config carries runDir, runId, pluginVersion, and stage-specific options. Each stage writes logs/<stage>-result.json:

{ "ok": true, "stage": "assess", "data": { "...": "..." }, "elapsedSec": 0.4 }

The Node tool reads only data; ok: false carries error and is surfaced as a tool failure. Artifacts live in the run directory, never only in the tool result, so a later turn can inspect them.

Gate enforcement

  • r_assess writes assessment.json with the SHA-256 of data/clean.csv.
  • r_analyze and r_report call rw_gate(), which rejects a missing/stale assessment, rejects STOP, and marks CONDITIONAL runs as exploratory.
  • r_report additionally requires analysis.json for the same data hash.

Install

From a source checkout of this directory:

plugin_manager({ action: "install_bundle", target: "/absolute/path/to/r-workbench" })

The bundle has no runtime npm dependencies; it uses Node built-ins and the local Rscript/R installation. R packages are installed into the user library by Rscript r/install-deps.R.

Testing

tests/run-tests.sh exercises the R stages directly against generated fixtures (valuable CSV, GB18030 text with preamble, Excel with dates, JSON, ZIP, WPS-compatible .et, a 20-row CONDITIONAL sample, and a deliberately low-value workbook). It verifies:

  • ingest/merge row counts, encoding detection, leading-zero preservation, and multi-sheet skip disclosure;
  • PROCEED, CONDITIONAL, and STOP decisions, including exploratory labeling;
  • STOP refusal by both r_analyze and r_report;
  • tampered clean.rds rejection (the gate is bound to both data artifacts);
  • calendar-month slope on a dataset with missing months;
  • HTML report content and DOCX word/document.xml structure when pandoc is available.

The real acceptance check is calling the installed tools from the Harness, not this script.

CLASSIFICATION EVIDENCE

分类依据

项目类型插件
功能分类模型与 MCP
规则置信度中

系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: deepseek-harness。