dsh-decision-layer 0.7.3 → 0.7.5

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.en.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  `dsh-decision-layer` adds structured, explicitly scoped decisions to the DeepSeek Harness (DSH) agent loop, backed by a pluggable adjudication backend. Dangerous-call gating, output self-check, tool narrowing, and loop prevention hook into the agent loop as automatic interventions.
6
6
 
7
- > **0.7.3 is a preview release.** The plugin works, but how much real value the adjudication interventions add is still being explored — every threshold is an unvalidated heuristic default. Treat it as something to observe, not a proven guarantee of impact. See [ROADMAP.md](<ROADMAP.md>) for scope and progress.
7
+ > **0.7.5 is a preview release.** The plugin works, but how much real value the adjudication interventions add is still being explored — every threshold is an unvalidated heuristic default. Treat it as something to observe, not a proven guarantee of impact. See [ROADMAP.md](<ROADMAP.md>) for scope and progress.
8
8
 
9
9
  ## Installation
10
10
 
@@ -38,9 +38,10 @@ Restart `dsh web` and refresh after installing or updating: the host and client
38
38
 
39
39
  - **Manual verdicts** — `decision_evaluate` and the `decision-layer` skill submit `noul` / `score` / `choice` questions; `decision_check_connection` tests connectivity. Manual calls do not count as automatic decisions and do not change agent behavior.
40
40
  - **Dangerous-call gate** — before a destructive tool call, a redacted summary asks the backend for a verdict; only a high-confidence deny blocks the call. Allow, ask, low confidence, backend failure, and invalid responses do not intervene and run the host's original path. Rules and the block confidence floor are configurable. Gate rows carry the redacted command/path plus this turn's task excerpt, so a block can be reviewed in context.
41
- - **Output self-check and quality trend** — scores the final reply at turn end (0–2), observe-only by default; an opt-in low-score re-prompt fires at most once per turn. Several consecutive high-confidence low scores tint the dock trigger grey → amber → red as a reminder. Self-check rows carry the turn number and the same task excerpt, so you can tell which turn was scored.
42
- - **Tool narrowing** — at turn start and again when a new user request arrives inside the same turn, drops optional tools by task relevance, intersecting the host-allowed set and never expanding it; each re-judgement releases the previous restriction first, the restriction is lifted when the turn stops, and notices such as time or background-job updates never trigger one. Core tools and keep-prefix matches are always kept, over-cap falls back to observe-only, too-few-kept is treated as untrustworthy and skipped, and small-context backends are batched automatically. Enforced by default; observe-only is available. Narrowing logs include the turn and step numbers plus an expandable task excerpt, so you can assess the dropped tools against the task; older logs are not backfilled.
41
+ - **Output self-check and quality trend** — scores the final reply at turn end (0–2), observe-only by default; an opt-in low-score re-prompt fires at most once per turn. Several consecutive high-confidence low scores tint the dock trigger grey → amber → red as a reminder. Self-check rows carry the turn number and the same task excerpt, and low rows carry a "low score" badge; the decision-analysis tab can show low scores only, so the scored turn is one click away in a long session (low-confidence low scores stay marked as noise to ignore).
42
+ - **Tool narrowing** — at turn start and again when a new user request arrives inside the same turn, drops optional tools by task relevance, intersecting the host-allowed set and never expanding it; each re-judgement releases the previous restriction first, the restriction is lifted when the turn stops, and notices such as time or background-job updates never trigger one. Core tools and keep-prefix matches are always kept, over-cap falls back to observe-only, too-few-kept is treated as untrustworthy and skipped, and small-context backends are batched automatically. Enforced by default; observe-only is available. Narrowing logs include the turn and step numbers plus an expandable task excerpt, so you can assess the dropped tools against the task; older logs are not backfilled. The host fixes the tool set before the decision point for a step fires, so a drop reaches the model from the next step on; narrowing covers the tool channel only — UI fences in the reply body and skill instructions are unaffected.
43
43
  - **Task-completion review** — when the user spells out multiple delivery conditions, each is judged satisfied / unsatisfied / insufficient evidence. Conditions come only from the turn's latest request, so a retired list cannot be revived, and this turn's tool evidence is primary (an earlier turn's success does not count; self-reported completion is not evidence). Observe-only by default, with an opt-in re-prompt.
44
+ - **Read-only process checks (off by default)** — off by default. After explicit enablement in advanced settings, progress heartbeats, repeated unresolved failures and edits after successful verification can schedule a background check within the same turn without another user prompt. The backend receives the current request and bounded tool evidence; findings are observation signals, with uncertain results kept separate. No prompts are added and no tools are restricted. Single flight, a rolling budget, short deadlines and stale-result cancellation keep the main agent independent. See [ADR-0017](<docs/adr/0017-read-only-execution-checkpoints.md>); task-level benefits have not been established.
44
45
  - **Loop guard** — denies the same call repeated consecutively past a threshold; deterministic, local, and backend-free. The per-feature switches do not affect it, but the session master switch pauses it too.
45
46
  - **Session panel and decision-analysis view** — the panel shows automatic-decision metrics, the session master switch, and the recent log; the "Decision analysis" tab shows a per-session process profile, trend backtest, and decision accuracy, with per-row ratings and a session intervention switch.
46
47
  - **Configuration and persistence** — each decision point has its own switch and configurable thresholds in the plugin details, written to `~/.config/dsh-decision-layer/config.json` and applied live. Defaults and field names are in [ADR-0006](<docs/adr/0006-configurable-thresholds.md>). You can also edit that file by hand, but only with valid values: an out-of-range value, a misspelled field, or a wrong type makes the whole config fail validation, the config page cannot load it, and every decision point reverts to its own safe default (see [ADR-0005](<docs/adr/0005-config-wholesale-replace-and-live-reload.md>)). Decision logs and session metrics persist for 30 days for review and calibration.
@@ -51,17 +52,18 @@ Restart `dsh web` and refresh after installing or updating: the host and client
51
52
  Once a key is configured, the plugin sends adjudication requests to the remote endpoint `https://api.typesafe.ai` (model `jev-latest`) by default. The payload carries real context:
52
53
 
53
54
  - Gate: the tool name plus redacted command/path summaries (up to 2048 characters each); no conversation content.
54
- - Self-check: this turn's request, the recent user asks and AI replies it needs for context (background only, each with its own budget, credentials masked), and the turn's final reply (up to about 24K characters).
55
+ - Self-check: this turn's request, the recent user asks and AI replies it needs for context (background only, each with its own budget, credentials masked), and the turn's final reply (opening and closing within a combined ~24K-character budget; the middle of an over-long reply is marked as omitted so the conclusion is not lost).
55
56
  - Narrowing: the current request, the necessary recent background, and the latest execution progress (tool name, ok/error, bounded command/path and shell-result excerpts) plus candidate tool names/descriptions.
57
+ - Process checks (off by default): when enabled, the current request and bounded tool names, outcomes, redacted command/path and shell excerpts for the active window. No file-read, search or webpage result bodies, reasoning or PTC scripts. Budgets and invalidation are specified in ADR-0017.
56
58
  - Task-completion review: delivery conditions extracted from this turn's latest user request (up to 20; a turn's earlier requests are not merged) and that request with its necessary background (credentials masked), this turn's tool evidence (tool name, ok/error, bounded command/path, plus a bounded shell-result excerpt with long unlabeled blobs masked again), and the first ~8K characters of the reply. Raw results from file reads, searches and network tools are never sent.
57
59
  - Manual verdicts: `decision_evaluate` and the `decision-layer` skill send whatever the agent submits, unchanged.
58
60
 
59
61
  Only real user messages are used as requests: host-injected content such as time notices, runtime details, memory snippets, system reminders and background-job updates is excluded or stripped, but anything you paste into the conversation still leaves your machine. The remote provider may log, retain, or otherwise use it depending on its terms; redaction and truncation reduce risk but are not anonymization.
60
62
 
61
- Two kinds of data are also stored locally for 30 days: decision logs in `~/.config/dsh-decision-layer/logs/` and session snapshots in `~/.config/dsh-decision-layer/state/`. They include redacted command/path summaries; every decision row's task excerpt is at most 512 characters (injected memory/system-reminder blocks removed, common credential forms masked) and a row may carry its turn and step numbers. No extra copies of the full background, execution progress, tool results or reply text are persisted — only the excerpt and decision counters. The excerpts are shown in the local session panel and decision-analysis view only; outbound adjudication content is the list above, and you can delete the local data yourself.
63
+ Two kinds of data are also stored locally for 30 days: decision logs in `~/.config/dsh-decision-layer/logs/` and session snapshots in `~/.config/dsh-decision-layer/state/`. They include redacted command/path summaries; every decision row's task excerpt is at most 512 characters (injected memory/system-reminder blocks removed, common credential forms masked) and a row may carry its turn and step numbers. No extra copies of the full background, execution progress, tool results or reply text are persisted — only the excerpt and decision counters. New source process checks additionally retain trigger codes, the evidence sequence boundary and candidate counts. Automatic decisions can retain request correlation ids, latency, physical request counts and reported usage. Missing usage is not zero; usage returned after a retry describes the successful response, not necessarily all billed attempts. An unfinished request at plugin disposal may lack its final cost record. The excerpts are shown in the local session panel and decision-analysis view only; outbound adjudication content is the list above, and you can delete the local data yourself.
62
64
 
63
65
  **If your session content is sensitive, prefer a locally deployed model** so adjudication data never leaves the machine. `tev1` is served natively by ollama at `/v1/systemone`; see [Running with a local tev1](<docs/en/deploy-tev1-with-plugin.md>). Any other local model works as long as it exposes a compatible `/v1/systemone` endpoint, pointed to from the config page.
64
66
 
65
67
  ## Safety boundary and development
66
68
 
67
- Automatic intervention only subtracts: the gate only denies, narrowing only removes tools, and neither grants new permissions. The gate only blocks on a high-confidence deny; on backend failure, low confidence, or an invalid response it does not intervene and runs the host's original path. Self-check, narrowing, and loop-guard errors skip intervention. The redacted gate summary sent to the backend carries only tool name and command/path with secret redaction; the plugin never reads file content, but the command itself (for example a heredoc or text written with echo) is included as-is. Both halves are TypeScript under strict mode: `npm run build` type-checks with `tsc` and emits `lib/host/*.js` plus `lib/client.js` ([ADR-0015](<docs/adr/0015-typed-host-build.md>)); `npm test` builds first and then runs the tests, and `npm run check` matches CI (build, tests, and the packed-tarball check). Node.js `>=20.11` at runtime. **Build output is not committed** ([ADR-0012](<docs/adr/0012-distribution-via-github-actions.md>)): `lib/` is gitignored and the source is the only source of truth. Releases run through `.github/workflows/release.yml`, which builds, gates, `npm pack`s and then asserts with `scripts/assert-pack.mjs` that the tarball really carries the host entry and `lib/client.js`, and leaks no sources — only then does it publish to npm or open a Release. It runs when a version bump lands on main and publishes through npm Trusted Publishing (OIDC), so no long-lived token is involved. Architecture decisions live in [docs/adr/](<docs/adr/README.md>): why each rule exists and what was rejected. 0.7.3 is a preview: the interventions work, but their real value and thresholds are still being explored — feedback on misjudgments and feel observed in the decision log is welcome.
69
+ Automatic intervention only subtracts: the gate only denies, narrowing only removes tools, and neither grants new permissions. The gate only blocks on a high-confidence deny; on backend failure, low confidence, or an invalid response it does not intervene and runs the host's original path. Self-check, narrowing, and loop-guard errors skip intervention. The redacted gate summary sent to the backend carries only tool name and command/path with secret redaction; the plugin never reads file content, but the command itself (for example a heredoc or text written with echo) is included as-is. Both halves are TypeScript under strict mode: `npm run build` type-checks with `tsc` and emits `lib/host/*.js` plus `lib/client.js` ([ADR-0015](<docs/adr/0015-typed-host-build.md>)); `npm test` builds first and then runs the tests, and `npm run check` matches CI (build, tests, and the packed-tarball check). Node.js `>=20.11` at runtime. **Build output is not committed** ([ADR-0012](<docs/adr/0012-distribution-via-github-actions.md>)): `lib/` is gitignored and the source is the only source of truth. Releases run through `.github/workflows/release.yml`, which builds, gates, `npm pack`s and then asserts with `scripts/assert-pack.mjs` that the tarball really carries the host entry and `lib/client.js`, and leaks no sources — only then does it publish to npm or open a Release. It runs when a version bump lands on main and publishes through npm Trusted Publishing (OIDC), so no long-lived token is involved. Architecture decisions live in [docs/adr/](<docs/adr/README.md>): why each rule exists and what was rejected. 0.7.5 is a preview: the interventions work, but their real value and thresholds are still being explored — feedback on misjudgments and feel observed in the decision log is welcome.
package/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  DeepSeek Harness(DSH)的结构化裁决插件。它把有明确判断标准的问题交给同协议的裁决后端,供 agent 在需要时使用,并在 agent loop 上接入危险门控、产出自检、工具收窄和防循环等自动介入。
6
6
 
7
- > **0.7.3 是体验版。** 插件功能已可用,但裁决介入能带来多少实际价值仍在探索中——各决策点的阈值都是未经验证的启发式默认值,建议先以观察心态体验,别当成经过验证的效果保证。功能与后续进度以 [ROADMAP.md](<ROADMAP.md>) 为准。
7
+ > **0.7.5 是体验版。** 插件功能已可用,但裁决介入能带来多少实际价值仍在探索中——各决策点的阈值都是未经验证的启发式默认值,建议先以观察心态体验,别当成经过验证的效果保证。功能与后续进度以 [ROADMAP.md](<ROADMAP.md>) 为准。
8
8
 
9
9
  ## 安装
10
10
 
@@ -38,9 +38,10 @@ dsh plugin --profile web add file:/绝对路径/dsh-decision-layer
38
38
 
39
39
  - **手动裁决**:`decision_evaluate` 工具与 `decision-layer` skill 可显式提交 `noul` / `score` / `choice` 问题,`decision_check_connection` 做连通测试;手动调用不计入自动裁决指标,也不改变 agent 行为。
40
40
  - **危险门控**:破坏性工具调用执行前用脱敏摘要请后端裁决,只有高置信「拒绝」才拦截;放行、询问、低置信、后端失败或响应不合法一律不介入,按宿主原路径执行。危险规则与拦截置信度门槛可配。门控日志带脱敏命令 / 路径与本轮任务节选,便于回看拦截是否合理。
41
- - **产出自检与质量趋势**:回合结束给最终回复打分(0–2),默认只记录;可开启低分补完,同一回合最多补一次。连续多次高置信低分时,dock 触发器图标会从灰变橙、变红作为提醒。自检日志带回合号与同一套任务节选,便于对照是哪一轮被打分。
42
- - **工具收窄**:回合开始时、以及同一回合内你提出新要求时,按任务相关性摘掉可选工具,只在宿主已允许的集合内取交集、不扩权;每次重新判断前先释放上一轮的旧限制,回合结束即解除,时间提示、后台通知等非用户要求不会触发重判。核心工具与保留前缀命中的工具始终保留,可选工具过多时自动降为仅观察、保留过少时视为判定不可信并跳过,对小上下文后端自动分批。默认真正生效,也可切到仅观察。收窄日志附带回合号、步骤号和可展开的任务节选,便于对照被摘除的工具评估判断是否合理;旧日志不会补录场景。
41
+ - **产出自检与质量趋势**:回合结束给最终回复打分(0–2),默认只记录;可开启低分补完,同一回合最多补一次。连续多次高置信低分时,dock 触发器图标会从灰变橙、变红作为提醒。自检日志带回合号与同一套任务节选,低分行另有「低评分」标记;决策分析页可一键「只看低评分」,长会话里也能直接定位到被打分的回合(低置信低分仍标为噪声,可忽略)。
42
+ - **工具收窄**:回合开始时、以及同一回合内你提出新要求时,按任务相关性摘掉可选工具,只在宿主已允许的集合内取交集、不扩权;每次重新判断前先释放上一轮的旧限制,回合结束即解除,时间提示、后台通知等非用户要求不会触发重判。核心工具与保留前缀命中的工具始终保留,可选工具过多时自动降为仅观察、保留过少时视为判定不可信并跳过,对小上下文后端自动分批。默认真正生效,也可切到仅观察。收窄日志附带回合号、步骤号和可展开的任务节选,便于对照被摘除的工具评估判断是否合理;旧日志不会补录场景。宿主在本步决策点触发前就已确定工具集,所以摘除从下一步起才进入模型请求;收窄只作用于工具通道——回复正文里的 UI 围栏、技能说明等非工具能力不受影响。
43
43
  - **任务完成核对**:用户明确列出多个交付条件时,逐项判定「已满足 / 未满足 / 证据不足」,条件只取本回合最近一次要求(避免旧清单被恢复),以本回合工具证据为准(上一回合的成功不算数,回复自述不算证据);默认只观察,可配补完。
44
+ - **只读过程检查(默认关闭)**:默认关闭,在插件详情页高级设置启用后,可在同一回合没有新用户输入时按进展心跳、持续未解决失败或验证后又修改产物安排后台检查。使用当前要求与有界工具证据,结果为「未见需复核问题 / 值得复核 / 证据不足」,低置信判断保持不确定;不追加提示、不限制工具、不改变已有自检/完成核对。每会话单在途、合并最新候选、滚动预算和短截止时间;错误、关闭、取消或任务变化不阻塞主任务。参数和边界见 [ADR-0017](<docs/adr/0017-read-only-execution-checkpoints.md>)。尚未取得效果对照数据。
44
45
  - **防循环**:同一调用连续重复超过阈值即拒绝,确定性本地逻辑,不依赖后端;不受各决策点开关影响,但会话总开关关闭时同样暂停。
45
46
  - **会话面板与决策分析页**:面板展示自动裁决指标、会话总开关和最近日志;「决策分析」tab 按会话展示过程画像、趋势回测与判断准确度,并支持逐条标注和开关本会话的自动介入。
46
47
  - **配置与持久化**:各决策点可独立开关,阈值在插件详情页调整,写入 `~/.config/dsh-decision-layer/config.json` 并热生效。默认值与字段说明见 [ADR-0006](<docs/adr/0006-configurable-thresholds.md>)。也可直接手改该文件,但只能写合法值:越界、拼错字段名或类型不符会让整份配置校验失败,配置页读不出来,各决策点退回各自的安全默认(见 [ADR-0005](<docs/adr/0005-config-wholesale-replace-and-live-reload.md>))。决策日志与会话指标落盘 30 天,供回看和校准。
@@ -51,14 +52,15 @@ dsh plugin --profile web add file:/绝对路径/dsh-decision-layer
51
52
  配置 Key 后,插件默认把裁决请求发往远程端点 `https://api.typesafe.ai`(模型 `jev-latest`)。裁决会携带具体上下文:
52
53
 
53
54
  - 门控:工具名与脱敏后的命令 / 路径摘要(各最多 2048 字符),不含对话内容。
54
- - 产出自检:本轮请求、最近必要的用户要求与 AI 回复(作背景,各有限额度,已遮蔽凭据),以及本轮最终回复(最多约 24K 字符)。
55
+ - 产出自检:本轮请求、最近必要的用户要求与 AI 回复(作背景,各有限额度,已遮蔽凭据),以及本轮最终回复(开头与结尾合计约 24K 字符;超长回复的中间部分会标注省略,避免只看开头漏掉结论)。
55
56
  - 工具收窄:当前有效请求、必要前文与最近执行进展(工具名、成败、有限的命令 / 路径与 shell 结果摘录)与候选工具的名称 / 描述。
57
+ - 过程检查(默认关闭):启用后发送当前要求和当前窗口的有界工具名、成败、脱敏命令/路径及 shell 摘录;不发送文件读取、搜索或网页结果原文、reasoning 或 PTC 脚本。输入限额和过期规则见 ADR-0017。
56
58
  - 完成核对:从本回合最近一次用户要求中提取的交付条件(最多 20 条,不合并同一回合的多次要求)、本回合最近一次要求与必要前文(作背景,已遮蔽凭据)、本回合工具证据(工具名、成败、有限的命令 / 路径,shell 类工具另有有限结果摘录,并对无标签的长随机串再遮蔽一次)、回复前约 8K 字符。文件读取、搜索与网络工具的结果原文不外发。
57
59
  - 手动裁决:`decision_evaluate` 与 `decision-layer` skill 会把 agent 提交的内容原样发送。
58
60
 
59
61
  进入裁决的用户消息只取真实的那些,时间提示、运行环境、记忆片段、系统提醒与后台通知等宿主注入内容会被排除或剥离;但用户自己粘贴进对话的内容仍会离开本机。远程服务提供方可能记录、留存或用于其他用途,具体取决于其服务条款;脱敏和截断只降低风险,不等于匿名化。
60
62
 
61
- 本地还会落盘两类数据,各保留 30 天:决策日志在 `~/.config/dsh-decision-layer/logs/`,会话快照在 `~/.config/dsh-decision-layer/state/`,其中包含脱敏后的命令 / 路径;各决策行的任务节选最多 512 字符(过滤记忆 / 系统提醒注入块并遮蔽常见凭据写法),行上可带回合号与步骤号。落盘不额外保存完整前文、执行进展、工具结果或回复原文,只保留节选与决策计数。节选展示在本地会话面板和决策分析页,外发内容以上一节逐项列出为准,可按需自行清理。
63
+ 本地还会落盘两类数据,各保留 30 天:决策日志在 `~/.config/dsh-decision-layer/logs/`,会话快照在 `~/.config/dsh-decision-layer/state/`,其中包含脱敏后的命令 / 路径;各决策行的任务节选最多 512 字符(过滤记忆 / 系统提醒注入块并遮蔽常见凭据写法),行上可带回合号与步骤号。落盘不额外保存完整前文、执行进展、工具结果或回复原文,只保留节选与决策计数;过程检查另保存触发类型、证据截至序号和候选数量,自动裁决可保存请求关联 id、耗时、后端请求次数和已报告用量。未知用量不补零,重试时成功响应的 usage 不代表所有尝试的总计费;插件卸载后仍未结算的请求可能缺失最终成本记录。节选展示在本地会话面板和决策分析页,外发内容以上一节逐项列出为准,可按需自行清理。
62
64
 
63
65
  **会话内容敏感时,推荐改用本地部署的模型**,让裁决数据不出本机。`tev1` 可经 ollama 原生的 `/v1/systemone` 端点直接接入,部署步骤见 [用本地 tev1 配合插件(部署指南)](<docs/zh/deploy-tev1-with-plugin.md>);其他本地模型只要提供兼容 `/v1/systemone` 的端点,同样可以在配置页把服务地址指向本机。
64
66
 
@@ -72,4 +74,4 @@ dsh plugin --profile web add file:/绝对路径/dsh-decision-layer
72
74
 
73
75
  **构建产物不入库**([ADR-0012](<docs/adr/0012-distribution-via-github-actions.md>)):`lib/` 已被 `.gitignore` 覆盖,源码是唯一事实来源。发布由 GitHub Actions 的 `release.yml` 完成——构建、跑门禁、`npm pack`,并用 `scripts/assert-pack.mjs` 断言产物里确实有 host 入口与 `lib/client.js`、且没有源码泄漏,之后才发 npm / 建 Release。该 workflow 在版本号变更推入 main 时自动执行;npm 侧使用 Trusted Publishing(OIDC),不依赖长期 token。
74
76
 
75
- 架构决策记录见 [docs/adr/](<docs/adr/README.md>):每条规则为什么存在、当时放弃了哪些备选。0.7.3 为体验版:介入能力已可用,但实际价值与阈值仍在探索,欢迎反馈决策日志观察到的误判与体感。
77
+ 架构决策记录见 [docs/adr/](<docs/adr/README.md>):每条规则为什么存在、当时放弃了哪些备选。0.7.5 为体验版:介入能力已可用,但实际价值与阈值仍在探索,欢迎反馈决策日志观察到的误判与体感。
package/docs/en/DETAIL.md CHANGED
@@ -7,7 +7,8 @@ A structured set of explicitly scoped decisions for the DeepSeek Harness agent l
7
7
  - **Dangerous-call gate** — before a destructive tool call, a redacted summary asks the backend for a verdict; only a high-confidence deny blocks the call, while backend failures, low confidence, and invalid responses fall back to the host's original path.
8
8
  - **Output self-check and quality trend** — scores the final reply at turn end and can append one re-prompt when the score is low and the model is confident; several consecutive confident low scores raise an alert on the trigger button.
9
9
  - **Task-completion review** — when the user lists multiple delivery conditions, each is judged satisfied / unsatisfied / insufficient evidence. Conditions come only from the turn's latest request, with this turn's tool evidence primary (an earlier turn's success does not count) and self-reported completion not counting.
10
- - **Tool narrowing** — at turn start, and again when a new user request arrives inside the same turn, judges each optional tool's relevance to the task and drops the ones not needed; each re-judgement releases the previous restriction first, and notices such as time or background-job updates trigger no re-judgement. It intersects the host-allowed set and never expands it.
10
+ - **Tool narrowing** — at turn start, and again when a new user request arrives inside the same turn, judges each optional tool's relevance to the task and drops the ones not needed; each re-judgement releases the previous restriction first, and notices such as time or background-job updates trigger no re-judgement. It intersects the host-allowed set and never expands it. The host resolves the tool set before the decision point for a step fires, so a drop reaches the model from the next step on; narrowing covers the tool channel only — UI fences in the reply body and skill instructions are unaffected.
11
+ - **Read-only process checks** — off by default; explicitly enable and save in advanced settings. Progress heartbeats, repeated unresolved failures and edits after verification can schedule background read-only judgements within a turn, without adding prompts or restricting tools; the session switch still applies. Low-confidence and insufficient evidence stay uncertain. Additional outbound data is limited to the current request and bounded redacted tool summaries; no file-read/search/webpage result bodies, reasoning or PTC scripts. Findings are separate from final-reply scores, and execution benefits have not been established.
11
12
  - **Loop guard** — denies the same call repeated consecutively past a threshold; deterministic and backend-free.
12
13
  - **Decision panel and analysis view** — shows automatic-decision metrics and the decision log, and lets you rate each decision correct / wrong / unsure; the analysis view's header can enable or disable automatic interventions for the current session.
13
14
 
package/docs/zh/DETAIL.md CHANGED
@@ -7,7 +7,8 @@
7
7
  - **危险调用门控**:破坏性工具调用执行前,用脱敏摘要请后端裁决;只有高置信「拒绝」才拦截,后端失败、低置信或响应不合法时一律按宿主原路径执行。
8
8
  - **产出自检与质量趋势**:回合结束给最终回复打分,低分且模型有把握时可自动补一轮;连续多次高置信低分会在触发按钮上给出告警。
9
9
  - **任务完成核对**:用户明确列出多个交付条件时,逐项判定「已满足 / 未满足 / 证据不足」,条件只取本回合最近一次要求,以本回合工具证据为准(上一回合的成功不算数),回复自述不算证据。
10
- - **工具收窄**:回合开始时、以及同一回合内出现新的用户要求时,判断各可选工具与任务的相关性并摘掉用不上的;每次重新判断前先释放旧限制,时间提示与后台通知不触发重判。只在宿主已允许的工具集内取交集,绝不扩权。
10
+ - **工具收窄**:回合开始时、以及同一回合内出现新的用户要求时,判断各可选工具与任务的相关性并摘掉用不上的;每次重新判断前先释放旧限制,时间提示与后台通知不触发重判。只在宿主已允许的工具集内取交集,绝不扩权。宿主在本步决策点触发前已解析工具集,所以摘除从下一步起才进入模型请求;收窄只覆盖工具通道,回复正文里的 UI 围栏、技能说明等非工具能力不受影响。
11
+ - **只读过程检查**:默认关闭,需在高级配置显式启用并保存。在同回合中按进展心跳、持续未解决失败和验证后修改安排后台只读判断,不追加提示或改工具限制;低置信与证据不足保留为不确定,仍受会话总开关控制。额外外发当前要求和有界脱敏的工具摘要,不发读文件、搜索、网页结果原文、reasoning 或 PTC 脚本。结果与最终回复自检分列,尚未证明提升执行效果。
11
12
  - **防循环**:同一调用连续重复超过阈值即拒绝,确定性本地逻辑,不依赖后端。
12
13
  - **决策面板与分析页**:展示自动裁决指标与决策日志,并可逐条标注「判对 / 判错 / 说不准」;分析页顶部可直接开关本会话的自动介入。
13
14