dsh-workpaper-gate
Manifest validWorkpaper completeness gate for DeepSeek Harness: one workpaper_gate tool that audits a valuation workpaper set for completeness - both the target design/template itself and the instance-versus-template structure - with configurable rules, and returns blocker, warning and info findings. Read-only.
dsh-workpaper-gate · 底稿完整性门禁审核器(v0.2)
把 M1 的「目标与底稿完整性审核」做成 DSH 插件:agent 工具 workpaper_gate 对估值模块 M1 做两层审核,输出 blocker / warning / info 三级 issues + markdown/JSON 报告。
数据底表 → workpaper_gate → ①目标(设计层/模板)自身完整性 + ②底稿实例 vs 模板(G14) → issues + 报告
只读输入,主审核路径永不写盘。
一、定位与 verify_design.py 的关系(P6)
- 本插件(
core/audit.py+spec/checks.json)是唯一权威执行器:规则清单、模板清单、核心表清单、门禁阶段全部配置化,补表/加规则只改 spec。 数据底表/_pipeline/verify_design.py是 legacy 兼容脚本:不再演进,仅作「instance 范围双跑一致」的对照。二者共享同一套 G14 口径,但有一处已知且有意的分歧,见下。- 已知分歧(C10):
verify_design.py的 C10 逻辑与_design/08_完整性门禁.md相反——它对「严重项>0 且未登记 user_confirm」判 PASS(ok = not uc.get("required")),对「已登记」判 FAIL。本插件严格按规范:严重项>0 且未登记 →c10(blocker);已登记 →c10-pending(warning)。在多个样本项目上实测:其 01 底稿含「严重 1~2」且未登记,本插件报 blocker,verify_design.py 报 0 失败。
二、版本三件套(G1)
每次输出 JSON 顶层带:
| 字段 | 含义 |
|---|---|
plugin_version | 插件版本(package.json / audit.py) |
spec_version + spec_hash | 规则版本号 + spec 文件内容 SHA256 前 16 位(改 spec 即变) |
design_version | 被审核数据底表的 _design/version.json.design_version |
三、接口(G6)
Agent 工具 workpaper_gate
workpaper_gate(
path: "...", # 数据底表根 / 单项目目录 / _design 目录;默认 <data-root>
scope: "both", # both | goal | instance
project: "<项目C>", # 可选,只审单项目
detail: false, # true 时 issues 含 info 级(空表等)
outputDir: "..." # 报告目录,默认 <root>/.workpaper-gate
)
返回 summary + issues[](每条 check_id / severity / project / path / sheet / item / hint)。
CLI(CI / 自测)
NODE="$HOME/.dsh/dsh-runtimes/dsh-primary-runtime/dependencies/node/bin/node"
cd "/path/to/plugins/dsh-workpaper-gate"
"$NODE" cli.js --scope both --fail-on blocker # blocker>0 退出 1,否则 0;引擎错误退出 2
"$NODE" cli.js --scope both --detail --json
"$NODE" cli.js --project <项目C> --scope instance
--fail-on blocker 只在 blocker 时退出 1;--fail-on warning 在 blocker 或 warning 时退出 1;info 永不触发失败。退出码:0 通过 / 1 门禁失败 / 2 引擎或参数错误。
四、严重度分级(G4)
| 级别 | 触发示例 |
|---|---|
blocker | 模板缺核心表、实例缺必填 Sheet/字段、表头与模板不一致、预测闭环断裂、审计严重项未登记、design_version 不一致、文件无法解析 |
warning | C10 严重项已登记待用户确认(c10-pending)、孤儿模板/规则、设计层无版本 |
info | 核心表仅有表头无数据(empty-sheet) |
五、配置化(G2)
规则/模板/核心表/门禁全部在 spec/checks.json:
goal.rules— 7 份规则文件清单goal.templates— 每份模板的file / core / any_of / exactinstance.core_sheets— 实例核心表清单gates— C2–C10 的阶段门控、必填表、必填字段、最小行数severity— 每个 check_id 的级别
补表/加规则 = 改 spec,core/audit.py 零 diff。
六、测试(G3)
"$PY" test/run_tests.py # PY 用 DSH 内置 python
负样本断言:02 模板缺预测比率→goal-template-sheets;00 表名多空格→c1;01 财务比率空表→c4+empty-sheet;损坏 xlsx→parse-error;正样本零误伤。
七、本轮关键发现
- 目标漂移(blocker):
_design/templates/02_投资建议书假设模板.xlsx缺「预测比率」Sheet,而 C5 要求实例必含——模板滞后于门禁规则(README §32.4 印证「预测比率只补进了实例、没回填模板」)。处置见 §八。 - 6 个未登记审计严重项(blocker):office_audit 在 6 个铺开项目的 01 底稿注入了「严重 1~2」且未登记 user_confirm,按 C10 应为 blocker(verify_design.py 因 C10 逻辑反了而漏报)。
- 孤儿规则(warning):
_design/下存在未登记进goal.rules的文件。
八、待人工决策(P8)
① 安装:本插件尚未写入 ~/.dsh/profiles/desktop(agent 运行时被文件沙箱拦截,无法代写)。请在终端执行:
CLI="/Applications/DeepSeek Harness.app/Contents/Resources/runtime/cli/bin/dsh"
"$CLI" plugin --profile desktop add \
link:/path/to/plugins/dsh-workpaper-gate
装完重启 DSH,GUI 工具列表出现 workpaper_gate。装后请跑一次 GUI 工具与 cli.js 比对(本轮因沙箱未装成,未完成 GUI vs CLI 比对)。
② 02 模板缺「预测比率」:C5 规则依据已查证——规范要求「实例必含预测比率」,而模板是实例结构来源,因此是模板滞后(目标 vs 实例漂移)。两条处置路径,请你拍板:
- 补表(推荐):给
02_投资建议书假设模板.xlsx增加「预测比率」Sheet,并按硬规则递增design_version; - 改规则:若认定「预测比率」是项目派生态而非模板结构,则从
spec/checks.json的goal.templates.02.core移除「预测比率」,只保留 C5 对实例的要求。
确认前不动 _design/。
九、目录
plugins/dsh-workpaper-gate/
├── index.js # 注册 workpaper_gate + 系统提示
├── runner.js # 定位内置 Python,跑 core/audit.py
├── cli.js # 独立 CLI(--fail-on / --project / --detail / --json)
├── core/audit.py # 执行器(只读 spec,openpyxl read_only+data_only)
├── spec/checks.json # 规则/模板/核心表/门禁/severity 配置
├── test/run_tests.py # 负样本测试
├── cordis.patch.yml
├── package.json
└── README.md
Versions
| Latest version | Published | Size |
|---|---|---|
| 0.2.0 | — | — |
Comments
Loading…
Similar plugins
by The-Data-Galaxy
A versioned DPIA workbench for DeepSeek Harness: trace facts, resolve gaps, reassess risks, and produce reviewable reports.
★ 3
Apache-2.0
Python
Oct 17, 2026
dsh plugin --profile web add dsh-dpia-workbenchby kw78
Model-facing Office tools for DeepSeek Harness: Word (.docx), Excel (.xlsx), and PowerPoint (.pptx) create/read/update with workspace-safe paths and PPT image embedding.
★ 35
↓ 2.1k/wk
MIT
TypeScript
Oct 13, 2026
dsh plugin --profile agent add dsh-office-toolsby bainianlaoyao
Codex-shaped coding tools and agent presets for GPT models on DeepSeek Harness: exec_command, write_stdin, apply_patch and view_image, plus OpenAI Chat Completions and Responses API routes, bridged to
★ 0
JavaScript
Sep 13, 2026
dsh plugin --profile web add dsh-codex-modeby rong-coder
dsh plugin for DeepSeek Harness: complete Office document tools for the agent (create/read/edit .docx/.xlsx/.pptx via OfficeCLI) plus high-fidelity document preview in the dsh web sidebar through dsh-
★ 6
MIT
TypeScript
Aug 17, 2026
dsh plugin --profile web add dsh-office-toolby godv61
Preset engineering workflows for DeepSeek Harness: a dev_task tool that gates stage transitions, artifacts, verification, review and commit scope, plus a web workbench for installing project or user s
★ 13
↓ 436/wk
MIT
TypeScript
Oct 14, 2026
dsh plugin --profile web add @godv61/dsh-task-engineby Neo65536-engineer
Read-only work reports for DeepSeek Harness: reconstruct what an agent task actually did from session logs — tools used, files read/written, commands run, test results, failures, token usage, and whether it finished. Fully offline, no API key, no data leaves your machine.
★ 1
MIT
JavaScript
Sep 26, 2026
dsh plugin --profile web add dsh-agent-log