dsh-approval-review 0.4.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README-zh.md CHANGED
@@ -80,7 +80,7 @@ dsh --profile <profile> --dump-config | grep -A6 'id: approval-review'
80
80
  | `reviewer.inspectLocalState` | `true` | 为 direct 模式启用受限本地只读检查。 |
81
81
  | `reviewer.tools` | `[read, glob, grep]` | 复核子代理的工具白名单。留空会回退到只读默认,而不是继承父代理的全部工具。 |
82
82
  | `reviewer.timeoutMs` | `120000` | 单次复核的硬超时。慢路由 + 推理型复核者实测要 ~50 秒;超时不是「否决」,而是按失败策略处理——出厂设置是转回人工链。 |
83
- | `reviewer.maxTokens` | `1024` | 输出上限。 |
83
+ | `reviewer.maxTokens` | 模型路由默认值 | 可选输出上限;默认不覆盖适配器或模型配置。 |
84
84
  | `reviewer.temperature` | `0` | 采样温度。 |
85
85
  | `reviewer.policyText` | *(内置策略)* | 替换裁决策略正文。 |
86
86
  | `reviewer.guidance` | *(无)* | 追加在策略之后的部署专属指引。 |
package/README.md CHANGED
@@ -100,7 +100,7 @@ schema defaults.
100
100
  | `reviewer.inspectLocalState` | `true` | Enable the bounded local inspector in direct mode. |
101
101
  | `reviewer.tools` | `[read, glob, grep]` | The reviewer child's tool allow-list. An empty list falls back to the read-only default rather than the parent's whole face. |
102
102
  | `reviewer.timeoutMs` | `120000` | Hard deadline for one reviewer call. A slow route plus a reasoning reviewer can take ~50s; a deadline that expires mid-review becomes a failure-policy outcome (a delegation to the human by default), not a verdict. |
103
- | `reviewer.maxTokens` | `1024` | Output cap. |
103
+ | `reviewer.maxTokens` | *(model route default)* | Optional output cap; omitted by default so the adapter/model configuration applies. |
104
104
  | `reviewer.temperature` | `0` | Sampling temperature. |
105
105
  | `reviewer.policyText` | *(shipping policy)* | Replaces the ruling policy text. |
106
106
  | `reviewer.guidance` | *(none)* | Extra deployment guidance appended after the policy. |
package/cordis.patch.yml CHANGED
@@ -44,7 +44,7 @@
44
44
  # here, and a deadline that expires mid-review is not a "no" — it is a
45
45
  # human handoff under the default `onReviewerFailure: delegate`.
46
46
  timeoutMs: 120000
47
- maxTokens: 1024
47
+ # maxTokens: omit to use the reviewer model route default
48
48
  temperature: 0
49
49
  argumentMaxChars: 4000
50
50
  argumentsBudgetChars: 16000
@@ -1,4 +1,13 @@
1
- # 0.4.0 审批策略与验证
1
+ # 审批策略与验证
2
+
3
+ ## 0.4.1 复核续轮修复
4
+
5
+ - 独立复核器在 `inspect_path` 后保留上一轮的 `source.replayState`,让 pi-ai 适配器恢复原生推理消息及签名,避免续轮丢失服务端要求的推理内容。
6
+ - `reviewer.maxTokens` 改为可选,默认不覆盖模型路由的输出预算;已有显式配置仍生效。未固定为 8192,也未改变推理等级。输出截断、超时与取证次数限制仍按原策略处理。
7
+ - DSH Desktop 2.0.10、DSH 0.1.5-rc.2 的真实 `pi-ai / openai-responses` 路由验证通过:沙箱拒绝后进入复核,独立检查脚本再续轮裁决,排他创建一次性探针并读回成功。该次复核耗时 5655 ms,未出现缺失推理内容错误。这是一次实测结果,不代表所有模型路由均已验证。
8
+ - 回归覆盖原生 replay 元数据续传、默认不传输出上限、显式上限保留,以及截断答案不得被当作有效裁决;发布检查为 14 个测试文件、299 项测试通过,类型检查和构建通过。
9
+
10
+ ## 0.4.0 审批策略
2
11
 
3
12
  本版合并审批页签语言切换、裁决语言选择和审批策略改动。默认使用独立模型复核,保留 DSH 的原始沙箱边界,减少常规操作的人工审批,同时对高风险操作单独校验授权和范围。
4
13
 
package/lib/index.d.ts CHANGED
@@ -67,8 +67,8 @@ interface ReviewerConfig {
67
67
  readonly tools: string[];
68
68
  /** Hard deadline for one reviewer call. */
69
69
  readonly timeoutMs: number;
70
- /** Output-token cap for one reviewer call. */
71
- readonly maxTokens: number;
70
+ /** Optional output-token cap; omission uses the adapter/model route default. */
71
+ readonly maxTokens?: number;
72
72
  /** Sampling temperature; the reviewer should be near-deterministic. */
73
73
  readonly temperature: number;
74
74
  /** Ruling policy appended to the reviewer prompt (Codex-style policy text). */
package/lib/index.js CHANGED
@@ -57,7 +57,7 @@ const Config = Schema.object({
57
57
  "grep"
58
58
  ]).description("The reviewer child's tool allow-list. An empty list falls back to the read-only default rather than the parent's whole face."),
59
59
  timeoutMs: Schema.number().step(1).min(1e3).default(12e4).description("Hard deadline for one reviewer call. A reasoning reviewer on a slow route can take tens of seconds; a deadline that is too tight turns into a fail-closed refusal (the default failure policy) rather than a verdict."),
60
- maxTokens: Schema.number().step(1).min(64).default(1024).description("Output-token cap for one reviewer call (`mode: direct`)."),
60
+ maxTokens: Schema.number().step(1).min(64).description("Optional output-token cap for direct review; omit to use the adapter/model route default."),
61
61
  temperature: Schema.number().min(0).max(2).default(0).description("Sampling temperature; 0 keeps the reviewer near-deterministic."),
62
62
  policyText: Schema.string().description("Ruling policy appended to the reviewer prompt."),
63
63
  guidance: Schema.string().description("Extra deployment-specific reviewer guidance."),
@@ -1193,8 +1193,8 @@ async function runReviewerCall(ctx, route, system, message, limits) {
1193
1193
  messages: [...messages],
1194
1194
  system,
1195
1195
  temperature: limits.temperature,
1196
- maxTokens: limits.maxTokens,
1197
1196
  signal: controller.signal,
1197
+ ...limits.maxTokens === void 0 ? {} : { maxTokens: limits.maxTokens },
1198
1198
  ...limits.inspect === void 0 ? {} : { tools: [INSPECTION_TOOL] },
1199
1199
  ...limits.sessionId === void 0 ? {} : { sessionId: limits.sessionId }
1200
1200
  };
@@ -1204,11 +1204,13 @@ async function runReviewerCall(ctx, route, system, message, limits) {
1204
1204
  if (calls.length === 0) return assembler;
1205
1205
  if (assembler.finish.kind === "max-tokens" || assembler.finish.kind === "error" || assembler.finish.kind === "aborted") return assembler;
1206
1206
  if (limits.inspect === void 0 || inspections + calls.length > 4) throw new Error("read-only investigation budget exhausted");
1207
+ const replayState = assembler.replayState;
1207
1208
  messages.push(createAssistantMessage({
1208
1209
  content: blocks,
1209
1210
  source: {
1210
1211
  provider: route.provider,
1211
- model: route.model
1212
+ model: route.model,
1213
+ ...replayState === void 0 ? {} : { replayState }
1212
1214
  }
1213
1215
  }));
1214
1216
  for (const call of calls) {
@@ -2117,7 +2119,7 @@ var ReviewRuntime = class {
2117
2119
  userIntent,
2118
2120
  ...req.reason === void 0 ? {} : { askReason: req.reason }
2119
2121
  }), {
2120
- maxTokens: this.config.reviewer.maxTokens,
2122
+ ...this.config.reviewer.maxTokens === void 0 ? {} : { maxTokens: this.config.reviewer.maxTokens },
2121
2123
  temperature: this.config.reviewer.temperature,
2122
2124
  timeoutMs: this.config.reviewer.timeoutMs,
2123
2125
  ...req.signal === void 0 ? {} : { signal: req.signal },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-approval-review",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "Codex-style agent auto-approval for DeepSeek Harness: an independent reviewer model decides allow/deny on the approval answerer chain, fail-closed, with a per-decision rationale — refusals and allows alike — in a dedicated Approvals tab. · DSH 插件:Codex 风格的 Agent 自动审批,独立 reviewer 模型裁决、fail-closed、每次审批(放行与否决)都留下详细理由,并在独立的「审批」页签中展示。",
5
5
  "type": "module",
6
6
  "main": "./lib/index.js",