xuxucodepractice-code/dsh-claim-guard0

dsh-claim-guard

A deterministic pre-write claim guard for supported DeepSeek Harness file tools.

包名
dsh-claim-guard
版本
0.1.0
许可证
MIT
最近更新
2026年9月3日

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:xuxucodepractice-code/dsh-claim-guard

Configuration

The bundle inserts this default row:

- insert:
    - id: dsh-claim-guard
      name: dsh-claim-guard
      config:
        rulesPath: claims.json
        include: ["**/*.md", "**/*.mdx", "**/*.txt"]
        exclude: []

rulesPath may be relative to exec.agent.session.header.cwd, or an explicitly configured absolute path outside the workspace. Target paths are still classified relative to the session workspace. exclude wins over include; include: [] includes every workspace target. Unknown config fields, explicit null, blank values, and wrong types are rejected.

Rules are strict UTF-8 JSON, not YAML and not JSON-with-comments:

{
  "version": 1,
  "options": { "window": 60, "caseSensitive": false },
  "blocked": [
    {
      "id": "manuscript-status",
      "match": "submitted",
      "message": "The synthetic demo manuscript is only in preparation."
    }
  ],
  "bounded": [
    {
      "id": "demo-composite-score",
      "match": "42.5%",
      "mustAccompany": ["synthetic benchmark", "合成示例"],
      "message": "This invented demo value must be labelled as synthetic."
    }
  ]
}

The rule file is limited to 262,144 bytes and 1–256 total rules. Input text is limited to 1,000,000 JavaScript UTF-16 code units. Matching is literal substring matching; case-insensitive mode uses ECMAScript toLowerCase() and does not add normalization, tokenization, fuzzy matching, or synonyms.

配置与规则

默认 rulesPath 是相对 session workspace 的 claims.json,也可显式配置仓库外 绝对路径;目标文件仍按 session workspace 分类。exclude 优先于 includeinclude: [] 表示 workspace 内所有目标。配置不接受未知字段、null、空白值 或错误类型。

规则必须是 UTF-8 严格 JSON,只包含 versionoptionsblockedbounded 规定字段。规则文件不超过 262,144 bytes,总规则 1–256 条,单次文本 不超过 1,000,000 个 UTF-16 code units。匹配是确定性的字面子串,不是事实判断、 正则、分词、模糊匹配或语义推理。完整合成示例见 claims.example.json