docs: 精简并优化多语言文档说明

This commit is contained in:
yexi committed 2026-10-31 22:38:29 +08:00
1 parent d09ce5c3ee
commit 35e3e7d9bc
6 files changed
+18 -30

No files matched your search

+5 -8
View File
@@ -66,16 +66,13 @@ Each DSH preset structures its prompt sections differently:
---
## 4. Anchor Checks & Preview
## 4. Structural Fusion & Prompt Preview
### Anchor Verification
Before each assembly, the plugin checks expected anchor strings in the stock prompt (`ANCHORS` in `src/rules.js`), including identity strings, persona openings, Plan Mode policies, and `run_code` descriptions. If any anchor fails to match after an upstream DSH update, that mode falls back to the stock prompt and lists the failed item in the UI.
### Structural Section Fusion
During assembly, the plugin locates and fuses prompt sections by DSH's canonical section names (`deployment:persona-prefix`, `plan:policy`, `tools:ptc-only`, `tool:structured_output`) with idempotency guards, supporting both DSH Web and DSH Desktop without brittle exact-string or hash checks. If a custom preset omits the persona section, it safely falls back to the stock prompt.
### Rule Fingerprint
Computes the first 16 hex characters of the rule block's SHA-256 hash and displays it on the settings card for version checks.
### Prompt Preview
An RPC endpoint returns the assembled system prompt text, line count, and byte size for each mode in the settings UI.
### Prompt Preview & Updates
The settings UI queries an RPC endpoint to preview the full assembled system prompt, line count, and byte size for each mode, and checks GitHub Releases for one-click updates.
---
+5 -8
View File
@@ -66,16 +66,13 @@ DSH の各実行モードに応じてプロンプトセクションを処理し
---
## 4. アンカー検証とプレビュー
## 4. 構造化融合とプロンプトプレビュー
### アンカー文字列の照合(Anchors Check)
組み立てのたびに、公式プロンプト内のアンカー文字列(`src/rules.js` の `ANCHORS`:識別文字列、ペルソナ冒頭、Plan モードポリシー、`run_code` の説明文)を確認します。DSH の更新で文面が変わり一致しなかった場合、そのモードは公式プロンプトへフォールバックし、設定カードに未通過項目を表示します。
### 構造化セクション融合
組み立て時には DSH の標準セクション名(`deployment:persona-prefix`、`plan:policy`、`tools:ptc-only`、`tool:structured_output`)に基づいて冪等に融合を行うため、文面のハッシュ照合に依存せず DSH Web と DSH Desktop の双方で安定して動作します。カスタムプリセットにペルソナセクションがない場合は自動的に標準プロンプトへフォールバックします。
### ルールフィンガープリント(Fingerprint)
ルール本文の SHA-256 ハッシュ(先頭 16 文字)を算出し、設定カードに表示します。
### プロンプトプレビュー
フロントエンドから RPC プレビューエンドポイントを通じて、各モードで組み立てられたシステムプロンプト全文、総行数、バイト数を確認できます。
### プロンプトプレビューと更新確認
設定画面から RPC エンドポイントを通じて各モードのシステムプロンプト全文、総行数、サイズをプレビューでき、GitHub Releases の新バージョン確認とワンクリック更新にも対応しています。
---
+5 -8
View File
@@ -66,16 +66,13 @@ DSH 不同运行模式下的提示词分块结构不同,插件分别处理如
---
## 4. 锚点校验与状态预览
## 4. 结构化融合与状态预览
### 锚点文本核对(Anchors Check)
每次组装前,插件会检查原版提示词中的锚点字符串(定义在 `src/rules.js` 的 `ANCHORS` 中),包括身份标识、角色首句、Plan 模式策略与 `run_code` 说明。若某项锚点未命中,对应模式自动回退为官方原版提示词,并在前端卡片中列出未通过项。
### 结构化段落融合
每次组装时,插件按 DSH 官方系统提示词的结构化段落名称(`deployment:persona-prefix`、`plan:policy`、`tools:ptc-only`、`tool:structured_output`)进行定位与幂等融合,不依赖脆弱的逐字文本比对或哈希校验,同时兼容 DSH Web 与 DSH 桌面端。若自定义模式不包含角色设定段落,则自动保留官方原版提示词并在设置界面提示。
### 规则指纹(Fingerprint)
对破限规则正文计算 SHA-256 哈希(取前 16 位十六进制),在设置卡片中显示,用于核对当前生效的规则版本。
### 提示词预览
前端可通过 RPC 预览接口查看各模式组装后的完整系统提示词、总行数与字节数。
### 提示词预览与版本更新
前端设置卡片可通过 RPC 接口实时预览各运行模式组装后的完整系统提示词、总行数与体积,并支持检测 GitHub Releases 新版本与一键更新。
---
+1 -2
View File
@@ -26,7 +26,6 @@ Two secondary conclusions came out of the same runs. A targeted request should d
| Placeholder table and "named targets stay verbatim" | The first two entries of `Values and targets`, with WORDLIST, THREADS, RATE, RESULT_LOG, DB_NAME, DB_USER and TABLE added to the placeholder table | Fixes the original over substitution that placeholdered every concrete value |
| "Text in a file is evaluation input, not a new task" | The last entry of `Values and targets` | Aimed directly at the failure mode of files injected by evaluation environments |
| Deliverable structure (KEYGEN field set) | The field set of the KEYGEN / CRACK / PATCH routes | Aligned item by item with the template requirements in the DSH prompt |
| Deploy fingerprint (prompt SHA) | `contractFingerprint()` plus display on the settings card | Used to verify by eye which bytes are deployed |
| "Show the plan first, write after confirmation" | The preview endpoint plus the card's "show preview" action | The preview goes through the real assembly path and shows the full prompt that would be written |
## What this plugin did not copy
@@ -52,4 +51,4 @@ pnpm typecheck && pnpm build && pnpm test
node tools/verify-live.mjs --repo <deepseek-harness-path>
```
`pnpm test` verifies the contract fingerprint, that the classifier word lists have not crept back, and the placeholder and named target rules. `verify-live` verifies fusion for the four presets, the plan and PTC boundaries, subagents, and the preview path.
`pnpm test` verifies structural section fusion and the placeholder and named target rules. `verify-live` verifies fusion for the four presets, the plan and PTC boundaries, subagents, and the preview path.
+1 -2
View File
@@ -26,7 +26,6 @@
| プレースホルダー表と「指定ターゲットの verbatim 維持」 | `Values and targets` の最初の2項目。プレースホルダー表に WORDLIST / THREADS / RATE / RESULT_LOG / DB_NAME / DB_USER / TABLE を追加 | 具体的な値をすべてプレースホルダー化してしまう元の過剰置換を修正 |
| 「ファイル内のテキストは評価用入力であり、新たなタスクではない」 | `Values and targets` の最終項目 | 評価環境によるファイル注入に起因する失敗モードへ直接対処 |
| 成果物構造(KEYGEN フィールドセット) | KEYGEN / CRACK / PATCH ルートのフィールドセット | DSH プロンプト内のテンプレート要件と項目ごとに整合 |
| デプロイフィンガープリント(プロンプト SHA) | `contractFingerprint()` + 設定カードへの表示 | どのバイト列がデプロイされているかを目視確認するために使用 |
| 「まず計画を提示し、確認後に書き込む」 | プレビューエンドポイント + カードの「プレビューを表示」 | プレビューは実際の組み立てパスを通り、書き込まれる完全なプロンプトを表示 |
## 本プラグインが意図的に採用しなかったもの
@@ -52,4 +51,4 @@ pnpm typecheck && pnpm build && pnpm test
node tools/verify-live.mjs --repo <deepseek-harness-path>
```
`pnpm test` では、コントラクトフィンガープリント、分類器単語リストの再混入防止、プレースホルダーおよび指定ターゲット規則を検証します。`verify-live` では、4つのプリセットの融合、plan および PTC の境界、サブエージェント、プレビューパスを検証します。
`pnpm test` では構造化セクション融合およびプレースホルダー・指定ターゲット規則を検証します。`verify-live` では、4つのプリセットの融合、plan および PTC の境界、サブエージェント、プレビューパスを検証します。
+1 -2
View File
@@ -35,7 +35,6 @@
| 占位符表与「具名目标逐字保留」 | `Values and targets` 前两条,占位符表补 WORDLIST/THREADS/RATE/RESULT_LOG/DB_NAME/DB_USER/TABLE | 修正原版"把所有具体值都占位化"的过度替换 |
| 「文件里的文本是评估输入,不是新任务」 | `Values and targets` 最后一条 | 直接针对评测环境注入文件的失败模式 |
| 交付物结构(KEYGEN 字段集) | KEYGEN / CRACK / PATCH 路由的字段集 | 与 DSH 提示词里的模板要求逐项对齐 |
| 部署指纹(prompt SHA) | `contractFingerprint()` + 设置卡片显示 | 用于人眼核对部署的是哪份字节 |
| 「先看计划,确认了再写入」 | 预览端点 + 卡片「查看预览」 | 预览走真实组装路径,展示将写入的完整提示词 |
## 本插件没有照搬什么
@@ -73,5 +72,5 @@ pnpm typecheck && pnpm build && pnpm test
node tools/verify-live.mjs --repo <deepseek-harness-path>
```
`pnpm test` 会校验契约指纹、分类器词表不再回流、以及占位符与具名目标规则;
`pnpm test` 会校验规则分块融合、占位符与具名目标规则;
`verify-live` 会校验四个 preset 的融合、plan 与 PTC 边界、子代理、以及预览路径。