iterate-plugin 3.5.7 → 3.7.0

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.
Files changed (79) hide show
  1. package/README.md +97 -22
  2. package/README.zh-CN.md +79 -19
  3. package/dist/approval-gate.js +143 -23
  4. package/dist/atomic-fs.js +148 -17
  5. package/dist/config-loader.js +516 -35
  6. package/dist/config-write.js +83 -22
  7. package/dist/evidence.js +141 -87
  8. package/dist/file-lock.js +193 -0
  9. package/dist/index.js +61 -28
  10. package/dist/jobs.js +56 -11
  11. package/dist/live.js +54 -14
  12. package/dist/meta-review.js +132 -28
  13. package/dist/method-scope.js +31 -8
  14. package/dist/review-scope.js +32 -9
  15. package/dist/review.js +96 -17
  16. package/dist/session-hooks.js +61 -14
  17. package/dist/skill-prompt.js +396 -66
  18. package/dist/tools/checkpoint.js +85 -19
  19. package/dist/tools/config.js +44 -2
  20. package/dist/tools/context.js +22 -5
  21. package/dist/tools/decision-log.js +106 -28
  22. package/dist/tools/defense-events.js +90 -31
  23. package/dist/tools/defense-store.js +28 -3
  24. package/dist/tools/experience-bank.js +108 -43
  25. package/dist/tools/experience-store.js +54 -4
  26. package/dist/tools/fix.js +347 -119
  27. package/dist/tools/history.js +68 -14
  28. package/dist/tools/present.js +80 -0
  29. package/dist/tools/prune.js +150 -53
  30. package/dist/tools/quality-gate.js +52 -2
  31. package/dist/tools/quality-store.js +17 -1
  32. package/dist/tools/review.js +158 -7
  33. package/dist/tools/transcript.js +173 -36
  34. package/dist/tools/triage.js +67 -12
  35. package/dist/tools/validate.js +115 -24
  36. package/dist/transcript.js +267 -4
  37. package/dist/working-directory.js +114 -0
  38. package/lib/client.js +1912 -512
  39. package/lib/parse.js +1001 -103
  40. package/package.json +16 -9
  41. package/src/approval-gate.ts +160 -23
  42. package/src/atomic-fs.ts +152 -17
  43. package/src/client/i18n.ts +517 -0
  44. package/src/client/index.ts +1031 -369
  45. package/src/client/session-cache.ts +54 -0
  46. package/src/config-loader.ts +549 -36
  47. package/src/config-write.ts +108 -26
  48. package/src/evidence.ts +194 -92
  49. package/src/file-lock.ts +211 -0
  50. package/src/index.ts +60 -29
  51. package/src/jobs.ts +63 -12
  52. package/src/live.ts +50 -12
  53. package/src/meta-review.ts +151 -34
  54. package/src/method-scope.ts +31 -8
  55. package/src/review-scope.ts +33 -10
  56. package/src/review.ts +96 -17
  57. package/src/session-hooks.ts +60 -13
  58. package/src/skill-prompt.ts +396 -66
  59. package/src/tools/checkpoint.ts +81 -19
  60. package/src/tools/config.ts +44 -2
  61. package/src/tools/context.ts +25 -5
  62. package/src/tools/decision-log.ts +114 -23
  63. package/src/tools/defense-events.ts +87 -31
  64. package/src/tools/defense-store.ts +30 -3
  65. package/src/tools/experience-bank.ts +112 -44
  66. package/src/tools/experience-store.ts +54 -5
  67. package/src/tools/fix.ts +258 -20
  68. package/src/tools/history.ts +74 -15
  69. package/src/tools/present.ts +89 -0
  70. package/src/tools/prune.ts +154 -51
  71. package/src/tools/quality-gate.ts +57 -2
  72. package/src/tools/quality-store.ts +18 -1
  73. package/src/tools/review.ts +155 -6
  74. package/src/tools/transcript.ts +178 -36
  75. package/src/tools/triage.ts +70 -13
  76. package/src/tools/validate.ts +138 -32
  77. package/src/transcript.ts +279 -4
  78. package/src/types.ts +29 -1
  79. package/src/working-directory.ts +126 -0
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # iterate-plugin for DeepSeek Harness (dsh)
2
2
 
3
- > dsh 桌面端的 iterate 质量指挥中心 + 经验银行插件(v3.2)。把 iterate 生态的同一套 review/fix loop 直接搬进 dsh 界面,新增质量门禁、经验银行、防御事件流与原生指挥操作。
4
- > The iterate ecosystem's quality command center + experience bank plugin for dsh (v3.2). Natively embedded inside the DeepSeek Harness (dsh) desktop client with quality gates, experience bank, defense events stream, and native command buttons.
3
+ > dsh 桌面端的 iterate 质量指挥中心 + 经验银行插件(v3.6)。把 iterate 生态的同一套 review/fix loop 直接搬进 dsh 界面,新增质量门禁、经验银行、防御事件流与原生指挥操作。
4
+ > The iterate ecosystem's quality command center + experience bank plugin for dsh (v3.6). Natively embedded inside the DeepSeek Harness (dsh) desktop client with quality gates, experience bank, defense events stream, and native command buttons.
5
5
 
6
6
  <p align="center">
7
7
  <a href="README.md"><strong>English</strong></a> ·
@@ -61,7 +61,7 @@ dsh plugin --profile web add iterate-plugin
61
61
 
62
62
  **v3.2 Quality Command Center**: the plugin has grown from a "passive observation panel" into an "active command center + knowledge base". It now ships quality gate view + writable compute, an experience bank with search / adopt / add, a defense events stream (record + bilingual labels), native command buttons, and a `task_mode` indicator.
63
63
 
64
- Besides 17 pure-function tools, it carries a **build-free Web UI layer** (convergence dashboard, triage panel, stats card, 10-tab runtime observatory, theme skin, etc.) that plugs straight into dsh's existing UI slots. Configuration (`iterate.config.yaml` and the review dimensions) is identical across the other two components of the iterate ecosystem ([skill](https://github.com/jingzhao-l/iterate-skill) / [headless engine](https://github.com/jingzhao-l/iterate-harness)) — zero migration cost.
64
+ Besides 17 pure-function tools, it carries a **build-free Web UI layer** (convergence dashboard, triage panel, stats card, 11-tab runtime observatory — live activity stream + F1–F10 —, theme skin, etc.) that plugs straight into dsh's existing UI slots. Configuration (`iterate.config.yaml` and the review dimensions) is identical across the other two components of the iterate ecosystem ([skill](https://github.com/jingzhao-l/iterate-skill) / [headless engine](https://github.com/jingzhao-l/iterate-harness)) — zero migration cost.
65
65
 
66
66
  ---
67
67
 
@@ -69,6 +69,7 @@ Besides 17 pure-function tools, it carries a **build-free Web UI layer** (conver
69
69
 
70
70
  - [✨ Features](#-features)
71
71
  - [📦 Installation](#-installation)
72
+ - [🧭 Using the UI in dsh](#️-using-the-ui-in-dsh)
72
73
  - [💬 Usage](#-usage)
73
74
  - [⚙️ Project configuration](#️-project-configuration)
74
75
  - [🔧 Registered tools](#-registered-tools)
@@ -103,15 +104,16 @@ Both modes share:
103
104
  - Validates after each round's fixes
104
105
  - Rolls back failed fixes, and can save / resume progress
105
106
 
106
- ### UI layer (build-free client slots, v3.2: 10 tabs)
107
+ ### UI layer (build-free client slots, v3.7: 11 tabs, bilingual)
107
108
 
108
- - **ConvergenceDashboard** (`conversation.input.dock`) — live round progress bar, severity stats, dimension badges, trend mini-chart above the input; normal mode also shows fix-count badges; plus a live workflow-phase chip (current phase + running/stopped) and a **v3.2 task_mode indicator (code / iterate)**, now backed by the persisted transcript (`iterate_status` / `iterate_transcript` emit `taskMode`).
109
- - **ObservatoryPanel** (`conversation.input.dock`) — a **ten-tab** runtime observatory below the input: live activity stream (type filter), review threads (expand / collapse all), convergence trend, finding locations (severity / dimension / search filter), fixes + rollback, checkpoint resume, decision timeline (type / round filter + search). **v3.2 tabs: Quality Gate (F8), Experience Bank (F9), Defense Events (F10)**; one-click JSON export of all observatory data (download, copy fallback). **v3.3+: F8/F9/F10 are live** — they scan the session stream for the latest `iterate_quality_gate` / `iterate_experience` / `iterate_defense_events` results and render real data (PASS/FAIL chip + per-dimension score bars, experience entries with adopt buttons + client-side search, defense type-count chips + filtered event stream), degrading to copy-able query instructions only when the session has none. **v3.5.3: reset actions surfaced** — F5 copies an `iterate_checkpoint clear` instruction, F8 an `iterate_quality_gate clear` instruction, F10 an `iterate_defense_events clear` instruction.
110
- - **TriagePanel** (`conversation.chat.turnTail`) — per-finding y/n/a triage, filtering, batch ops (incl. select-all), keyboard shortcuts, localStorage persistence, copy-YAML / apply-instruction. **v3.2: native command buttons** (approve architectural fix, trigger new round, rollback to checkpoint). **v3.3: §8 指派修复 (assign)** — one click copies an `iterate_fix` instruction carrying every in-scope finding (respecting the batch toggle).
109
+ - **ConvergenceDashboard** (`conversation.input.dock`) — live round progress bar, severity stats, dimension badges, trend mini-chart above the input; normal mode also shows fix-count badges; plus a live workflow-phase chip (current phase + running/stopped) and a **task_mode indicator (code / iterate)**, now backed by the persisted transcript (`iterate_status` / `iterate_transcript` emit `taskMode`). While a run is active the dashboard switches to a running state (round + phase) instead of the static empty state, and the start buttons are hidden.
110
+ - **ObservatoryPanel** (`conversation.input.dock`) — an **eleven-tab** runtime observatory below the input: **live activity stream** (default tab, type filter) + **F1** review threads (expand / collapse all), **F2** convergence trend (incl. the per-round comparison table: findings raised / fixed / severity mix / validation outcomes), **F3** finding locations (severity / dimension / search filter), **F4** fixes + rollback, **F5** checkpoint resume, **F6** run console, **F7** decision timeline (type / round filter + search), **F8** Quality Gate, **F9** Experience Bank, **F10** Defense Events. Number-key shortcuts: `1`–`9` jump to F1–F9, `0` to F10, `-` back to the live stream. **F8/F9/F10 are live** — they scan the session stream for the latest `iterate_quality_gate` / `iterate_experience` / `iterate_defense_events` results and render real data (PASS/FAIL chip + per-dimension score bars, experience entries with adopt buttons + client-side search, defense type-count chips + filtered event stream); when the session stream has none they distinguish "no data on disk" from "not pulled yet" and offer a **拉取磁盘快照 (pull disk snapshot)** instruction that has the model call the read-side tools and echo the `.iterate/` artifacts back into the stream. One-click JSON export of all observatory data — manifest + live + `qualityGate` / `experienceBank` / `defenseEvents` / `report` (download, copy fallback). **v3.5.3: reset actions surfaced** — F5 copies an `iterate_checkpoint clear` instruction, F8 an `iterate_quality_gate clear` instruction, F10 an `iterate_defense_events clear` instruction.
111
+ - **TriagePanel** (`conversation.chat.turnTail`) — per-finding triage with `y` (keep → fix), `n` (skip), `a` (known-intentional) keyboard shortcuts and `↑`/`↓` navigation (focus-guarded: only active while the panel has focus), filtering, batch ops (incl. select-all), localStorage persistence. **Write-back closed loop**: the primary button copies an `iterate_triage apply` instruction for the marked entries (the tool validates, dedupes, backs up, rolls back on failure); a secondary button copies the raw `known_intentional` YAML; **回读已写入条目** copies an `iterate_triage list` instruction to confirm what actually landed. Copy payloads are aligned to the target tool schemas. **v3.2: native command buttons** (approve architectural fix, trigger new round, rollback to checkpoint). **v3.3: §8 指派修复 (assign)** — one click copies an `iterate_fix` instruction carrying every in-scope finding (respecting the batch toggle).
111
112
  - **StatsCard** (`conversation.chat.turnTail`) — convergence stats, round history, trend chart and completion summary when no findings remain.
112
113
  - **iterate theme skin** (`theme.overrideTokens`) — a warm-amber 13-token `--dsw-*` override, light/dark modes, togglable in settings.
113
114
  - **ProgressCapsule** (`shell.overlay`) — popup notification on each round completion / convergence (incl. convergence confirm).
114
- - **SettingsPanel** (`settings.section`) — theme toggle, triage-persistence notes, config-management guide, runtime status overview (artifact layout + view/cleanup tool guide), one-click triage data reset.
115
+ - **SettingsPanel** (`settings.section`) — theme toggle, triage-persistence notes, config-management guide (covers `validation.commands` / `language` / `personalization.known_intentional` with an explicit "empty validation.commands = unprotected" warning; a field picker generates the matching `iterate_config write` instruction), **v3.7: a 回读当前配置 (read back current config) button that closes the write → read-back loop** — it copies an `iterate_config read` instruction and, once the model echoes the result into the session, shows the current value of the selected field, runtime status overview (artifact layout + view/cleanup tool guide + disk-snapshot pull), one-click triage data reset.
116
+ - **Bilingual UI (v3.7)** — every piece of UI chrome (panels, empty states, tabs, badges, settings, stop-reason and completion labels) ships in 简体中文 and English. Pick the language under **Settings → 界面语言 / Interface language**; the choice persists in `localStorage` (`iterate-ui-lang`) and otherwise auto-detects from `navigator.language` (a stored choice always wins, and auto-detection never writes a preference). **Model-facing copy deliberately stays Chinese** — the `build*Instruction` payloads and the copy-paste guides are contract text mirroring `SKILL.md`, so the two expanded guides carry a 「中文(粘贴给模型的契约文案)」 chip instead of looking like a missed translation.
115
117
 
116
118
  The UI layer is **defensive by design**: it degrades gracefully if any of `slots` / `theme` / `React` is unavailable — it never crashes the client.
117
119
 
@@ -122,9 +124,10 @@ Beyond the 17 registered tools (full reference further down), the plugin closes
122
124
  - **Findings triage loop** — review → UI triage (y/n/a) → `iterate_triage` writes back `known_intentional` → auto-filtered next round
123
125
  - **Structured fix system** — each fix backs up first, writes a registry entry, records the diff; a failed validation can be reverted with `iterate_rollback`
124
126
  - **Breakpoint resume** — checkpoints saved at the start of each round; interrupted long iterations can resume
125
- - **History audit** — `iterate_history` reads the decision log (filtered by type / time / count) and the fix-registry summary to audit run process and fix details
127
+ - **History audit** — `iterate_history` reads the decision log (filtered by `type` / `since` / `round` / fixed `file` / `limit`, default latest 50, cap 200) plus a fix-registry summary (per-round fixed/failed counts, scoped by the same round/file filters) to audit run process and fix details
126
128
  - **Runtime cleanup** — `iterate_prune` removes stale decision-log entries, stale checkpoints, orphaned fix backups, empty rounds and stray temp files left by crashed atomic writes; dry-run by default (report-only), real cleanup requires `dryRun:false`, and every cleanup is logged
127
- - **Config read / write** — `iterate_config` supports validated, backed-up, rollback-capable partial writes
129
+ - **Config read / write** — `iterate_config` supports validated, backed-up, rollback-capable partial writes; since v3.7 the settings page can also **read the effective config back** (instruction + inline current value)
130
+ - **Session-aware project root (v3.7)** — on dsh ≥ `0.2.1-alpha.2` the plugin follows the session's *mutable* working directory through the host's `WorkingDirectoryService` instead of the immutable `Session.header.cwd`, so a mid-session directory switch redirects everything under `.iterate/` (config, decision log, checkpoints, fix backups, approval policy) to the workspace actually in use. The service is feature-detected with a `header.cwd` fallback on every failure mode, so older hosts behave exactly as before.
128
131
  - **v3.2 Experience Bank** — `iterate_experience` queries historical fixes and patterns with search / filter / adopt, and can persist new verified fixes (`add`) — re-adding the same pattern+dimension bumps its hit count instead of duplicating it
129
132
  - **v3.2 Quality Gate** — `iterate_quality_gate` reads quality gate status with per-dimension convergence rates and PASS/FAIL, and can recompute + persist a fresh certificate (`compute`) from this round's findings / validation results (real convergence from `findingsByRound`)
130
133
  - **v3.2 Defense Events** — `iterate_defense_events` queries defense events (precondition failures, rollbacks, invariant violations, assumption falsifications) and can `record` new ones; readable labels follow the project language (en / zh)
@@ -167,7 +170,48 @@ Then add to your profile `cordis.patch.yml`:
167
170
  name: 'iterate-plugin'
168
171
  ```
169
172
 
170
- > The package carries its own `dsh.bundle.patch` (i.e. `cordis.patch.yml`); the npm package's `files` whitelist is `src` / `lib` / `dist` / `cordis.patch.yml` / `README.md` / `LICENSE`. `dist/` is the compiled output of the TypeScript server-side logic, shipped with the package so it works with dsh's `github:owner/repo#ref` git-clone install (Node does not strip TS types under `node_modules`).
173
+ > The package carries its own `dsh.bundle.patch` (i.e. `cordis.patch.yml`); the npm package's `files` whitelist is `src` / `lib` / `dist` / `cordis.patch.yml` / `README.md` / `README.zh-CN.md` / `LICENSE`. `dist/` is the compiled output of the TypeScript server-side logic, shipped with the package so it works with dsh's `github:owner/repo#ref` git-clone install (Node does not strip TS types under `node_modules`).
174
+
175
+ ---
176
+
177
+ ## 🧭 Using the UI in dsh
178
+
179
+ The browser client has **no filesystem access** — every panel renders from the dsh session stream (tool results the model echoes back). That is why the plugin's UI is built around one interaction paradigm: **copy an instruction from a button → paste it back into the chat → the model calls the matching tool → the panel fills**. Client buttons never spawn processes.
180
+
181
+ ### Starting an iteration (empty dashboard)
182
+
183
+ With no report yet, the convergence dashboard shows two buttons — **「完整迭代」 (full iteration)** and **「仅评审」 (review-only)** — each copying a **natural-language instruction** to the clipboard. These are **not slash commands**: the plugin registers no `/iterate` command; paste the text into the conversation and the model runs the iterate workflow through dsh's `workflow` tool. The full-iteration instruction also asks the model to preflight `validation.commands` first — if none is configured it stops and asks you to write one (the same fail-closed rule the workflow enforces), so an unprotected run never looks green.
184
+
185
+ While a run is active the dashboard switches to a **running state** (round + workflow-phase chips) instead of the static empty state, and the start buttons are hidden.
186
+
187
+ ### Triage panel shortcuts
188
+
189
+ Focus must be inside the triage panel (the handler ignores keys typed elsewhere):
190
+
191
+ - `y` — keep the finding for fixing; `n` — skip it; `a` — mark it known-intentional (write-back candidate)
192
+ - `↑` / `↓` — move between findings (auto-advances after a verdict)
193
+ - batch buttons `y` / `n` / `a` apply the verdict to all findings at once
194
+
195
+ To write verdicts back, mark entries with `a` and click **生成应用指令** — it copies an `iterate_triage apply` instruction for exactly those entries (the tool validates, dedupes by file|dimension|line, backs up, and rolls back on failure). Paste it back, then click **回读已写入条目** to copy an `iterate_triage list` instruction and confirm what actually landed — the write-back → readback closed loop.
196
+
197
+ ### Observatory tabs & shortcuts
198
+
199
+ The observatory below the input carries **11 tabs**: the live activity stream (default) plus **F1**–**F10**:
200
+
201
+ `F1` review threads · `F2` convergence trend (incl. per-round comparison) · `F3` finding locations · `F4` fixes + rollback · `F5` checkpoint resume · `F6` run console · `F7` decision timeline · `F8` quality gate · `F9` experience bank · `F10` defense events
202
+
203
+ Press `1`–`9` to jump to F1–F9, `0` for F10, and `-` to return to the live stream.
204
+
205
+ ### Disk snapshot pull & export
206
+
207
+ - **拉取磁盘快照 (pull disk snapshot)** — a new session (or a refresh) starts with empty panels even when `.iterate/` already holds artifacts on disk. The pull button copies an instruction asking the model to call the read-side tools (`iterate_status`, `iterate_transcript` `read`, `iterate_quality_gate` `read`, `iterate_experience` `list`, `iterate_defense_events` `list`, `iterate_history`) and echo their **full** results into the stream; the session scanners then fill the dashboard, F2, F5, F8, F9, F10. Empty states distinguish "no data on disk" from "not pulled yet".
208
+ - **导出 JSON (export)** — one click serializes the whole observatory to JSON: manifest + live feed + `qualityGate` + `experienceBank` + `defenseEvents` + `report` (download first, copy-to-clipboard fallback).
209
+
210
+ ### Config management from the settings page
211
+
212
+ The settings section copies a config-edit guide that lists the supported `iterate.config.yaml` fields — including `validation.commands` (with an explicit warning that an empty list means every round runs unprotected) — and offers a **field picker**: choose a field, and the button generates the matching `iterate_config write` instruction (schema-validated, auto-backup, auto-rollback) for you to paste back.
213
+
214
+ **Reading back what actually landed** — the matching **回读当前配置 / Read back current config** button copies an `iterate_config` `{ operation: "read" }` instruction; when the model echoes the result into the session, the card shows the current value of the selected field right under the picker (arrays inline, e.g. `["npm test","npm run lint"]`). Three states are told apart honestly: *nothing read back yet*, *the value*, and *read back but this field is absent* (the built-in defaults are in play). If the clipboard refuses, the read instruction is revealed in the panel for manual copy — the button is never a dead end.
171
215
 
172
216
  ---
173
217
 
@@ -244,7 +288,7 @@ validation:
244
288
 
245
289
  ---
246
290
 
247
- ## 🔧 Registered tools (v3.2: 17)
291
+ ## 🔧 Registered tools (17)
248
292
 
249
293
  - `iterate_config` — read / write `iterate.config.yaml`. `operation=read` returns the full config or a named section; `operation=write` schema-validates, backs up, then merges and writes — auto rollback on failure
250
294
  - `iterate_validate` — run a whitelisted validation command, return the result
@@ -257,7 +301,7 @@ validation:
257
301
  - `iterate_rollback` — roll back an applied fix: restore the file from backup, remove that FixRecord from the registry, append a `revert` log. Used after a failed round validation
258
302
  - `iterate_checkpoint` — iteration breakpoint: `save` persists progress to `.iterate/checkpoint.json`, `load` reads it back, `resume` loads + bumps the resume counter (interruption recovery), `clear` removes it (bounded findings payload, `round ≤ maxRounds` enforced). Resumable interrupted long iterations
259
303
  - `iterate_status` — summarize current iteration state: mode, current/last round, fixes applied, remaining architectural, decision-log entry count, whether a checkpoint exists; **v3.4: also surfaces the persisted quality-gate snapshot, experience-bank summary, and defense-events summary** (`qualityGate` / `experienceBank` / `defenseEvents`)
260
- - `iterate_history` — read iteration history (read-only): decision-log entries (filter by `type` / `since` / `limit`, default latest 50, cap 200) + fix-registry summary (per-round fixed/failed counts). For auditing the run, tracing logs, and inventorying fixes
304
+ - `iterate_history` — read iteration history (read-only): decision-log entries (filter by `type` / `since` / `round` / fixed `file` / `limit`, default latest 50, cap 200) + fix-registry summary (per-round fixed/failed counts, scoped by the same round/file filters; a `file`-scoped summary recomputes counts from the kept records). For auditing the run, tracing logs, and inventorying fixes
261
305
  - `iterate_prune` — clean runtime artifacts: stale decision-log entries (by `retainDays`, default 30), stale checkpoints, orphaned fix backups, empty rounds, stray temp files (crashed atomic writes). Dry-run by default (report-only); real cleanup with `dryRun:false`, each cleanup logged
262
306
  - `iterate_transcript` — runtime observatory: persist review transcripts, threads, fixes, and nudge directions to `.iterate/transcript.json` for the client observatory
263
307
  - `iterate_experience` — **v3.2** query the experience bank (list / search / get), `add` a new verified fix (re-adding the same pattern+dimension bumps its hit count instead of duplicating it), or **v3.5 remove a stale/incorrect entry by `id`** so bad experiences never resurface. Persists to `.iterate/experience.json`
@@ -291,13 +335,18 @@ All runtime state lives under `.iterate/` at the project root (can be excluded v
291
335
  ### Node.js / DSH compatibility
292
336
 
293
337
  - **Node.js**: `>=20` (`package.json` `engines.node`).
294
- - **DSH**: declares `dsh.compatibility.dshReleases` — `compatible` for the official
295
- `0.1.1-rc.1`, `0.1.2-alpha.4`, `0.1.2-alpha.5`, `0.1.2-rc.1`, and `0.1.3-alpha.1`
296
- releases. The plugin is built against `@deepseek-ai/dsh-tools` /
297
- `@deepseek-ai/dsh-util-values` `0.1.2-rc.1` and uses only public contracts
298
- (tool registration, client slots + theme, bundle patch). `0.1.3-alpha.1` is a
299
- source declaration matching the current DSH release window; it does not use any
300
- API changed by that release.
338
+ - **DSH**: declares `dsh.compatibility.dshReleases` in `package.json` — **that
339
+ field is the single source of truth** for release compatibility (this README
340
+ mirrors it verbatim; update both together). The following official releases
341
+ are declared `compatible`: `0.1.1-rc.1`, `0.1.2-alpha.4`, `0.1.2-alpha.5`,
342
+ `0.1.2-rc.1`, `0.1.3-alpha.1`, `0.1.5-alpha.1`, `0.1.5-alpha.2`,
343
+ `0.1.5-rc.1`, `0.1.5-rc.2`, `0.1.6-alpha.1`, `0.1.6-alpha.2`,
344
+ `0.1.7-alpha.1`, `0.1.7-alpha.2`, `0.1.7-rc.1`, `0.1.7-rc.2`, `0.2.0-rc.1`,
345
+ `0.2.0-rc.2`, `0.2.1-alpha.1`, `0.2.1-alpha.2` (19 releases, `0.1.1-rc.1` …
346
+ `0.2.1-alpha.2`).
347
+ The plugin is built against `@deepseek-ai/dsh-tools` /
348
+ `@deepseek-ai/dsh-util-values` `0.2.1-alpha.2` and uses only public contracts
349
+ (tool registration, client slots + theme, bundle patch).
301
350
  - **Disposable-Profile evidence (real, `dsh` CLI `0.1.1-rc.1`)**: on a temp
302
351
  `$DSH_HOME`, `dsh plugin --profile <p> add <this-repo>` installed the bundle in
303
352
  ~449 ms; `dsh --profile <p> --dump-config` composed the `iterate-plugin` bundle
@@ -336,7 +385,33 @@ following capabilities; elevated capability means a DSH Profile install stays
336
385
  ### Dependencies
337
386
 
338
387
  Runtime dependencies: `@deepseek-ai/cordis`, `@deepseek-ai/dsh-tools`,
339
- `@deepseek-ai/dsh-util-values`, `js-yaml` — all pinned exact versions. No
388
+ `@deepseek-ai/dsh-util-values`, `js-yaml` — all pinned exact versions.
389
+
390
+ #### Upstream adoption (v3.7.0 → dsh `0.2.1-alpha.2`)
391
+
392
+ - **Adopted — the mutable session working directory.** `src/working-directory.ts`
393
+ resolves the project root through `ctx.get('workingDirectory').get(session)`
394
+ when the host offers it (feature-detected; `header.cwd` fallback on a missing
395
+ service, a throwing service, hostile getters or a non-string result). Needed
396
+ because as of `0.2.1-alpha.2` the immutable header keeps the *original*
397
+ project by design, so reading it after a directory switch would anchor the
398
+ review to the wrong checkout.
399
+ - **Evaluated, not adopted:**
400
+ - *Session state-record APIs* (experimental plugins writing/reading their own
401
+ session records) — reaching into shell-owned record internals is fragile
402
+ across alpha releases, and iterate's cross-session state already lives in
403
+ `.iterate/`.
404
+ - *Shared `AGENTS.md` agents directory (`DSH_AGENTS_HOME`)* — a host-level
405
+ instruction concern; the plugin injects its own workflow prompt.
406
+ - *Experimental Git Worktrees plugin* — an upstream agent-workflow feature;
407
+ the plugin's own `git.use_worktree` config predates it and is unrelated
408
+ (per-round git hygiene for the iterate loop).
409
+ - *Removal of the `both` tool-presentation mode* — the plugin never set a
410
+ presentation mode (it renders `presentCall` cards), so nothing to migrate.
411
+ - *Installing the dsh CLI globally from the plugin* — disk cost for a plugin
412
+ that never shells out at runtime.
413
+ - All five `@deepseek-ai/*` packages are pinned to the exact `0.2.1-alpha.2`
414
+ (`@deepseek-ai/cordis` stays `4.0.5-alpha.1`). No
340
415
  install-time lifecycle scripts (`preinstall`/`install`/`postinstall`/`prepare`);
341
416
  only `prepublishOnly` (build) runs on publish.
342
417
 
@@ -376,7 +451,7 @@ npm test
376
451
 
377
452
  All tests pass:
378
453
 
379
- - **466 unit tests green**, type-check clean
454
+ - **Full unit suite + type-check clean** (`npm test`, `npm run typecheck`) — the exact count is intentionally not pinned here to avoid doc drift; see `CHANGELOG.md` for per-release magnitudes
380
455
  - Coverage: dedupe, filter, sort, multi-round convergence, meta-review audit, path safety, timeout clamping, config read/write + rollback, triage merge, diff computation, checkpoint validation, fix registry, history read + filter, prune cleanup report + dry-run semantics, UI pure functions (select-all key, runtime status guide), **v3.2: experience bank, quality gate, defense events, approval-gate fail-open path**.
381
456
 
382
457
  ---
package/README.zh-CN.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # iterate-plugin for DeepSeek Harness (dsh)
2
2
 
3
- > dsh 桌面端的 iterate 质量指挥中心 + 经验银行插件(v3.2)。把 iterate 生态的同一套 review/fix loop 直接搬进 dsh 界面,新增质量门禁、经验银行、防御事件流与原生指挥操作。
3
+ > dsh 桌面端的 iterate 质量指挥中心 + 经验银行插件(v3.6)。把 iterate 生态的同一套 review/fix loop 直接搬进 dsh 界面,新增质量门禁、经验银行、防御事件流与原生指挥操作。
4
4
 
5
5
  <p align="center">
6
6
  <a href="README.md"><strong>English</strong></a> ·
@@ -60,7 +60,7 @@ dsh plugin --profile web add iterate-plugin
60
60
 
61
61
  **v3.2 质量指挥中心**:插件已从"被动观察面板"升级为"主动指挥中心 + 知识库"。新增质量门禁读取与可写计算(compute)、经验银行(检索 / 采纳 / 新增 add)、防御事件流(记录 + 中英双语标签)、原生命令按钮与 `task_mode` 指示器。
62
62
 
63
- 除 17 个纯函数工具外,还内置一套**免构建的 Web UI 层**(收敛看板、分诊面板、统计卡片、10 标签页运行时观测台、主题皮肤等),直接挂在 dsh 客户端的既有 UI 槽位上。配置方式(`iterate.config.yaml` 与审查维度)与迭代生态的另外两个组件([技能](https://github.com/jingzhao-l/iterate-skill) / [无头引擎](https://github.com/jingzhao-l/iterate-harness))完全一致,迁移零成本。
63
+ 除 17 个纯函数工具外,还内置一套**免构建的 Web UI 层**(收敛看板、分诊面板、统计卡片、11 页签运行时观测台——实时活动流 + F1–F10——、主题皮肤等),直接挂在 dsh 客户端的既有 UI 槽位上。配置方式(`iterate.config.yaml` 与审查维度)与迭代生态的另外两个组件([技能](https://github.com/jingzhao-l/iterate-skill) / [无头引擎](https://github.com/jingzhao-l/iterate-harness))完全一致,迁移零成本。
64
64
 
65
65
  ---
66
66
 
@@ -68,6 +68,7 @@ dsh plugin --profile web add iterate-plugin
68
68
 
69
69
  - [✨ 特性](#-特性)
70
70
  - [📦 安装](#-安装)
71
+ - [🧭 在 dsh 中使用 UI](#️-在-dsh-中使用-ui)
71
72
  - [💬 使用](#-使用)
72
73
  - [⚙️ 项目配置](#️-项目配置)
73
74
  - [🔧 注册工具](#-注册工具)
@@ -102,15 +103,16 @@ dsh plugin --profile web add iterate-plugin
102
103
  - 每轮修复后验证
103
104
  - 修复失败自动回滚
104
105
 
105
- ### UI 层(客户端免构建槽位,v3.2:10 个标签页)
106
+ ### UI 层(客户端免构建槽位,v3.7:11 个页签,双语)
106
107
 
107
- - **收敛看板 `ConvergenceDashboard`**(`conversation.input.dock`)— 输入框上方实时显示轮次进度条、严重度统计、维度徽章、趋势迷你图;normal 模式另显示修复计数徽章;还有运行阶段芯片(当前工作流阶段 + 运行中/已结束)与 **v3.2 task_mode 指示器(code / iterate)**。
108
- - **运行时观测台 `ObservatoryPanel`**(`conversation.input.dock`)— 输入框下方**十个标签页**运行时观测台:实时活动流(支持按活动类型筛选)、审查线程(支持全部展开/全部收起)、收敛趋势、发现定位(支持按严重度/维度/关键词筛选)、修复与回滚、断点恢复、决策时间线(支持按类型/轮次筛选与关键词搜索)。**v3.2 新增标签:质量门禁(F8)、经验银行(F9)、防御事件(F10)**;支持一键导出全部观测数据为 JSON(优先下载,失败回退复制)。**v3.5.3 新增重置操作**:F5 复制 `iterate_checkpoint clear`、F8 复制 `iterate_quality_gate clear`、F10 复制 `iterate_defense_events clear` 指令。
109
- - **Findings 分诊面板 `TriagePanel`**(`conversation.chat.turnTail`)— 逐条 y/n/a 判定,支持筛选、批量(含一键全选所有 findings)、键盘快捷键、localStorage 持久化、复制 YAML / 应用指令。**v3.2:原生命令按钮**(批准架构修复、触发新一轮、回滚到断点)。
108
+ - **收敛看板 `ConvergenceDashboard`**(`conversation.input.dock`)— 输入框上方实时显示轮次进度条、严重度统计、维度徽章、趋势迷你图;normal 模式另显示修复计数徽章;还有运行阶段芯片(当前工作流阶段 + 运行中/已结束)与 **task_mode 指示器(code / iterate)**。运行期间看板切换为"运行中"状态(显示轮次与阶段),并隐藏启动按钮。
109
+ - **运行时观测台 `ObservatoryPanel`**(`conversation.input.dock`)— 输入框下方**十一个页签**运行时观测台:**实时活动流**(默认页,支持按活动类型筛选)+ **F1** 审查线程(全部展开/全部收起)、**F2** 收敛趋势(含跨轮对比表:每轮 findings / fixed / 严重度分布 / 验证结果)、**F3** 发现定位(按严重度/维度/关键词筛选)、**F4** 修复与回滚、**F5** 断点恢复、**F6** 运行控制台、**F7** 决策时间线(按类型/轮次筛选与关键词搜索)、**F8** 质量门禁、**F9** 经验银行、**F10** 防御事件。数字键快捷键:`1`–`9` 跳到 F1–F9,`0` 到 F10,`-` 回实时活动流。**F8/F9/F10 为实时数据**——扫描会话流中最近一次 `iterate_quality_gate` / `iterate_experience` / `iterate_defense_events` 结果并渲染真实数据(PASS/FAIL 徽章 + 分维度评分条、经验条目(含采纳按钮 + 客户端搜索)、防御类型计数芯片 + 筛选后的事件流);会话流中没有数据时区分"磁盘无数据"与"尚未拉取",并提供**拉取磁盘快照**指令(让模型调用只读工具、把 `.iterate/` 产物回显进会话流)。一键导出全部观测数据为 JSON——manifest + live + `qualityGate` / `experienceBank` / `defenseEvents` / `report`(优先下载,失败回退复制)。**v3.5.3 新增重置操作**:F5 复制 `iterate_checkpoint clear`、F8 复制 `iterate_quality_gate clear`、F10 复制 `iterate_defense_events clear` 指令。
110
+ - **Findings 分诊面板 `TriagePanel`**(`conversation.chat.turnTail`)— 逐条分诊,键盘快捷键 `y`(保留→修复)、`n`(跳过)、`a`(已知有意)与 `↑`/`↓` 移动(焦点守卫:仅面板内焦点时生效),支持筛选、批量(含一键全选所有 findings)、localStorage 持久化。**写回闭环**:主按钮复制已标记条目的 `iterate_triage apply` 指令(工具负责校验、去重、备份、失败回滚);次按钮复制裸 `known_intentional` YAML;**回读已写入条目**复制 `iterate_triage list` 指令核对实际落盘内容。复制载荷与目标工具 schema 对齐。**v3.2:原生命令按钮**(批准架构修复、触发新一轮、回滚到断点)。
110
111
  - **收敛统计卡片 `StatsCard`**(`conversation.chat.turnTail`)— 无 findings 时显示收敛统计、历史轮次、趋势图、完成摘要。
111
112
  - **iterate 主题皮肤**(`theme.overrideTokens`)— 暖琥珀配色的 13 个 `--dsw-*` token 覆盖,明暗双模式,可在设置页开关。
112
113
  - **进度胶囊 `ProgressCapsule`**(`shell.overlay`)— 每轮完成 / 收敛时右下角弹出通知(含收敛确认)。
113
- - **iterate 设置区 `SettingsPanel`**(`settings.section`)— 主题开关、分诊持久化说明、配置管理指引、运行时状态概览(产物布局 + 查看/清理工具指引)、一键清空分诊数据。
114
+ - **iterate 设置区 `SettingsPanel`**(`settings.section`)— 主题开关、分诊持久化说明、配置管理指引(覆盖 `validation.commands` / `language` / `personalization.known_intentional`,并显式警告"validation.commands 为空 = 本轮不受任何测试保护";字段选择器可生成对应的 `iterate_config write` 指令),**v3.7:新增「回读当前配置」补齐写入 → 回读闭环**——复制 `iterate_config read` 指令,模型把结果回显进会话后,卡片就地展示所选字段的当前值;运行时状态概览(产物布局 + 查看/清理工具指引 + 磁盘快照拉取)、一键清空分诊数据。
115
+ - **双语 UI(v3.7)**——所有界面文案(面板、空态、页签、徽标、设置、停止原因与完成汇总)均提供简体中文与 English。在**设置 → 界面语言 / Interface language**切换;选择持久化在 `localStorage`(`iterate-ui-lang`),否则按 `navigator.language` 自动探测(已保存的选择始终优先,且自动探测不会写入偏好)。**面向模型的文案有意保持中文**——`build*Instruction` 指令与可粘贴指引是与 `SKILL.md` 对齐的契约文本,因此两处展开的指引带「中文(粘贴给模型的契约文案)」标签,避免被误当成漏翻。
114
116
 
115
117
  UI 层为**防御式设计**:`slots` / `theme` / `React` 任一不可用时自动降级,不会崩溃客户端。
116
118
 
@@ -121,9 +123,10 @@ UI 层为**防御式设计**:`slots` / `theme` / `React` 任一不可用时自
121
123
  - **findings 分诊闭环** — 审查 → UI 分诊(y/n/a)→ `iterate_triage` 写回 `known_intentional` → 下一轮自动过滤
122
124
  - **结构化修复系统** — 每次修复先备份、写注册表、记录 diff,验证失败可 `iterate_rollback` 还原
123
125
  - **断点续跑** — 长迭代在每轮开头保存 checkpoint,中断后可恢复进度
124
- - **历史审计** — `iterate_history` 读取决策日志(按类型/时间/数量过滤)与修复注册表汇总,审查运行过程与修复明细
126
+ - **历史审计** — `iterate_history` 读取决策日志(可按 `type` / `since` / `round` / 修复文件 `file` / `limit` 过滤,默认取最新 50 条,上限 200 条)与修复注册表汇总(各轮 fixed/failed 计数,按同一 round/file 过滤收窄),审查运行过程与修复明细
125
127
  - **运行时清理** — `iterate_prune` 清理过期的决策日志条目、陈旧断点、孤儿修复备份、空轮次与原子写入崩溃残留的临时文件;默认 dry-run 只报告不删除,显式 `dryRun:false` 才真正清理,每次清理写入决策日志
126
- - **配置读写** — `iterate_config` 支持带校验、备份、回滚的局部写入
128
+ - **配置读写** — `iterate_config` 支持带校验、备份、回滚的局部写入;v3.7 起设置页还能**回读生效配置**(指令 + 就地展示当前值)
129
+ - **跟随会话的工作目录(v3.7)** — 在 dsh ≥ `0.2.1-alpha.2` 上,插件通过宿主的 `WorkingDirectoryService` 解析项目根,而不是不可变的 `Session.header.cwd`:会话中途切换目录后,`.iterate/` 下的一切(配置、决策日志、断点、修复备份、审批策略)都会跟着当前工作区走。该服务按特性探测,任何失败路径(服务缺失/抛错/敌意 getter/非字符串结果)都回退到 `header.cwd`,旧宿主行为完全不变。
127
130
  - **v3.2 经验银行** — `iterate_experience` 以检索 / 过滤 / 采纳查阅历史修复与模式,并可 `add` 持久化新的已验证修复——重复添加同一 pattern + dimension 时累加命中次数而非重复写入
128
131
  - **v3.2 质量门禁** — `iterate_quality_gate` 读取质量门禁状态(各维度收敛率 + PASS/FAIL),并可基于本轮 findings / 验证结果 `compute` 重新计算并持久化一份新的质量凭证(收敛率来自 `findingsByRound` 的真实收敛序列)
129
132
  - **v3.2 防御事件流** — `iterate_defense_events` 查询防御事件(前置条件失败、回滚、不变量违反、假设证伪),并可 `record` 记录新事件;可读标签跟随项目语言(en / zh)
@@ -166,7 +169,48 @@ pnpm add /path/to/iterate-skill/harness/iterate-plugin
166
169
  name: 'iterate-plugin'
167
170
  ```
168
171
 
169
- > 插件包自带 `dsh.bundle.patch`(即 `cordis.patch.yml`),npm 包内 `files` 已白名单化(`src` / `lib` / `dist` / `cordis.patch.yml` / `README.md` / `LICENSE`)。其中 `dist/` 为 TypeScript 服务端逻辑的编译产物,随包分发以兼容 dsh 的 `github:owner/repo#ref` git-clone 安装方式(Node 不擦除 `node_modules` 下的 TS 类型)。
172
+ > 插件包自带 `dsh.bundle.patch`(即 `cordis.patch.yml`),npm 包内 `files` 已白名单化(`src` / `lib` / `dist` / `cordis.patch.yml` / `README.md` / `README.zh-CN.md` / `LICENSE`)。其中 `dist/` 为 TypeScript 服务端逻辑的编译产物,随包分发以兼容 dsh 的 `github:owner/repo#ref` git-clone 安装方式(Node 不擦除 `node_modules` 下的 TS 类型)。
173
+
174
+ ---
175
+
176
+ ## 🧭 在 dsh 中使用 UI
177
+
178
+ 浏览器客户端**没有文件系统访问权限**——所有面板渲染的都是 dsh 会话流里的数据(模型回显的工具结果)。因此本插件的 UI 围绕一个交互范式构建:**从按钮复制指令 → 粘贴回对话 → 模型调用对应工具 → 面板自动填充**。客户端按钮从不启动任何进程。
179
+
180
+ ### 启动一次迭代(空态仪表盘)
181
+
182
+ 还没有任何 report 时,收敛看板显示两个按钮——**「完整迭代」**与**「仅评审」**——各自把一段**自然语言指令**复制到剪贴板。这些**不是 slash 命令**:插件没有注册 `/iterate` 之类的命令;把文本粘贴进对话即可,模型会通过 dsh 的 `workflow` 工具运行 iterate 工作流。完整迭代指令还要求模型先预检 `validation.commands`——若未配置则停下来提示你写入(与工作流自身的 fail-closed 规则一致),不受测试保护的迭代绝不会看起来"全绿"。
183
+
184
+ 运行期间,看板切换为**运行中状态**(显示轮次与工作流阶段芯片),并隐藏启动按钮。
185
+
186
+ ### 分诊面板快捷键
187
+
188
+ 快捷键只在分诊面板内焦点时生效(在别处输入时处理器会忽略):
189
+
190
+ - `y` — 保留该 finding(进入修复);`n` — 跳过;`a` — 标记为已知有意(写回候选)
191
+ - `↑` / `↓` — 在 findings 之间移动(判定后自动前进)
192
+ - 批量按钮 `y` / `n` / `a` 一次性对全部 findings 应用同一判定
193
+
194
+ 要写回配置,用 `a` 标记条目后点击**生成应用指令**——它会为这些条目复制一条 `iterate_triage apply` 指令(工具负责校验、按 file|dimension|line 去重、备份、失败回滚)。粘贴回会话后,点击**回读已写入条目**复制 `iterate_triage list` 指令核对实际落盘内容——写回 → 回读闭环。
195
+
196
+ ### 观测台页签与快捷键
197
+
198
+ 输入框下方的观测台共 **11 个页签**:实时活动流(默认页)+ **F1–F10**:
199
+
200
+ `F1` 审查线程 · `F2` 收敛趋势(含跨轮对比)· `F3` 发现定位 · `F4` 修复与回滚 · `F5` 断点恢复 · `F6` 运行控制台 · `F7` 决策时间线 · `F8` 质量门禁 · `F9` 经验银行 · `F10` 防御事件
201
+
202
+ 按 `1`–`9` 跳到 F1–F9,`0` 到 F10,`-` 回实时活动流。
203
+
204
+ ### 磁盘快照拉取与导出
205
+
206
+ - **拉取磁盘快照**——新会话(或刷新后)面板是空的,哪怕磁盘上 `.iterate/` 早有产物。拉取按钮复制一条指令,让模型调用只读工具(`iterate_status`、`iterate_transcript` `read`、`iterate_quality_gate` `read`、`iterate_experience` `list`、`iterate_defense_events` `list`、`iterate_history`)并把**完整**结果回显进会话流;会话扫描器随之填充看板、F2、F5、F8、F9、F10。空态文案区分"磁盘无数据"与"尚未拉取"。
207
+ - **导出 JSON**——一键把整个观测台序列化为 JSON:manifest + 实时流 + `qualityGate` + `experienceBank` + `defenseEvents` + `report`(优先下载,失败回退复制到剪贴板)。
208
+
209
+ ### 从设置页管理配置
210
+
211
+ 设置区复制一份配置编辑指引,列出支持的 `iterate.config.yaml` 字段——包括 `validation.commands`(并显式警告:留空意味着每一轮迭代都不受任何测试保护)——并提供**字段选择器**:选中字段后,按钮会生成对应的 `iterate_config write` 指令(schema 校验、自动备份、失败自动回滚)供你粘贴回会话。
212
+
213
+ **回读实际写入的结果**——配套的**「回读当前配置」**按钮复制 `iterate_config` 的 `{ operation: "read" }` 指令;模型把结果回显进会话后,卡片会在选择器下方展示所选字段的当前值(数组内联展示,如 `["npm test","npm run lint"]`)。三种状态被诚实区分:*尚未回读*、*当前值*、*已回读但没有该字段*(说明走的是内置默认值)。若剪贴板被拒绝,回读指令会在面板中展开供手动复制——按钮不会成为死路。
170
214
 
171
215
  ---
172
216
 
@@ -243,7 +287,7 @@ validation:
243
287
 
244
288
  ---
245
289
 
246
- ## 🔧 注册工具(v3.2:17 个)
290
+ ## 🔧 注册工具(17 个)
247
291
 
248
292
  - `iterate_config` — 读取 / 写入 `iterate.config.yaml`。`operation=read` 返回完整配置或指定 section;`operation=write` 做 schema 校验、备份后局部合并写入,失败自动回滚
249
293
  - `iterate_validate` — 运行白名单验证命令,返回结果
@@ -256,7 +300,7 @@ validation:
256
300
  - `iterate_rollback` — 回滚一个已应用的修复:从备份还原文件、从注册表移除该 FixRecord、追加 `revert` 日志。用于某轮验证失败后
257
301
  - `iterate_checkpoint` — 迭代断点:`save` 保存当前进度到 `.iterate/checkpoint.json`,`load` 读回,`resume` 加载并累加恢复计数(中断恢复),`clear` 清除(findings 载荷有上限,强制 `round ≤ maxRounds`)。长迭代可中断续跑
258
302
  - `iterate_status` — 汇总当前迭代状态:模式、当前轮/总轮、已修复数、剩余 architectural、决策日志条数、是否存在 checkpoint;**v3.4:同时返回持久化的质量门禁快照、经验银行摘要与防御事件摘要**(`qualityGate` / `experienceBank` / `defenseEvents`)
259
- - `iterate_history` — 读取迭代历史(只读):决策日志条目(可按 `type` / `since` / `limit` 过滤,默认取最新 50 条,上限 200 条)+ 修复注册表汇总(各轮 fixed/failed 计数)。用于审查运行过程、审计日志、盘点修复
303
+ - `iterate_history` — 读取迭代历史(只读):决策日志条目(可按 `type` / `since` / `round` / 修复文件 `file` / `limit` 过滤,默认取最新 50 条,上限 200 条)+ 修复注册表汇总(各轮 fixed/failed 计数,按同一 round/file 过滤收窄;`file` 过滤时按保留的记录重算计数)。用于审查运行过程、审计日志、盘点修复
260
304
  - `iterate_prune` — 清理运行时产物:过期决策日志条目(按 `retainDays`,默认 30 天)、陈旧断点、孤儿修复备份、空轮次、崩溃原子写入残留的临时文件。默认 dry-run 只报告不删除;`dryRun:false` 才真正清理,每次清理写入决策日志
261
305
  - `iterate_transcript` — 运行时观测台:把审查转录、线程、修复与 nudge 指令持久化到 `.iterate/transcript.json`,供客户端观测台读取
262
306
  - `iterate_experience` — **v3.2** 查询经验银行(list / search / get),或 `add` 一条新的已验证修复:重复添加同一 pattern + dimension 累加命中次数而非重复写入。**v3.5 新增 `remove`:按 `id` 删除过时或错误的经验条目**。持久化到 `.iterate/experience.json`
@@ -290,11 +334,7 @@ validation:
290
334
  ### Node.js / DSH 兼容范围
291
335
 
292
336
  - **Node.js**:`>=20`(`package.json` 的 `engines.node`)。
293
- - **DSH**:在 `dsh.compatibility.dshReleases` 中声明官方 `0.1.1-rc.1`、
294
- `0.1.2-alpha.4`、`0.1.2-alpha.5`、`0.1.2-rc.1`、`0.1.3-alpha.1` 五个版本为
295
- `compatible`。插件基于 `@deepseek-ai/dsh-tools` / `@deepseek-ai/dsh-util-values`
296
- `0.1.2-rc.1` 构建,只使用公开契约(工具注册、客户端 slots + theme、bundle patch);
297
- `0.1.3-alpha.1` 为匹配当前 DSH 发布窗口的源码声明,插件不使用该发布变更的任何 API。
337
+ - **DSH**:`package.json` 的 `dsh.compatibility.dshReleases` 字段是发布兼容性的**唯一真源**(本 README 逐字镜像该字段;两者需同步更新)。以下官方版本声明为 `compatible`:`0.1.1-rc.1`、`0.1.2-alpha.4`、`0.1.2-alpha.5`、`0.1.2-rc.1`、`0.1.3-alpha.1`、`0.1.5-alpha.1`、`0.1.5-alpha.2`、`0.1.5-rc.1`、`0.1.5-rc.2`、`0.1.6-alpha.1`、`0.1.6-alpha.2`、`0.1.7-alpha.1`、`0.1.7-alpha.2`、`0.1.7-rc.1`、`0.1.7-rc.2`、`0.2.0-rc.1`、`0.2.0-rc.2`、`0.2.1-alpha.1`、`0.2.1-alpha.2`(共 19 个版本,`0.1.1-rc.1` … `0.2.1-alpha.2`)。插件基于 `@deepseek-ai/dsh-tools` / `@deepseek-ai/dsh-util-values` `0.2.1-alpha.2` 构建,只使用公开契约(工具注册、客户端 slots + theme、bundle patch)。
298
338
  - **一次性 Profile 证据(真实,`dsh` CLI `0.1.1-rc.1`)**:在临时 `$DSH_HOME` 下
299
339
  `dsh plugin --profile <p> add <本仓库>` 约 449ms 完成安装;`dsh --profile <p>
300
340
  --dump-config` 正确合成 `iterate-plugin` bundle patch;`dsh plugin --profile <p>
@@ -325,7 +365,27 @@ validation:
325
365
  ### 依赖
326
366
 
327
367
  运行时依赖:`@deepseek-ai/cordis`、`@deepseek-ai/dsh-tools`、
328
- `@deepseek-ai/dsh-util-values`、`js-yaml`——全部精确锁版。无安装期生命周期脚本
368
+ `@deepseek-ai/dsh-util-values`、`js-yaml`——全部精确锁版。
369
+
370
+ #### 上游采纳记录(v3.7.0 → dsh `0.2.1-alpha.2`)
371
+
372
+ - **已采纳——可变的会话工作目录。** `src/working-directory.ts` 通过
373
+ `ctx.get('workingDirectory').get(session)` 解析项目根(特性探测;服务缺失、
374
+ 抛错、敌意 getter 或非字符串结果一律回退 `header.cwd`)。必须采纳的原因:
375
+ 自 `0.2.1-alpha.2` 起,不可变的 header 按设计保留*原始*项目,切换目录后再读它
376
+ 会把评审锚定到错误的检出。
377
+ - **已评估、未采纳:**
378
+ - *Session 状态记录接口*(实验插件读写自己的会话记录)——依赖 shell 内部记录结构,
379
+ 跨 alpha 版本极脆弱;iterate 的跨会话状态本就存放在 `.iterate/`。
380
+ - *共享 agents 目录的 `AGENTS.md`(`DSH_AGENTS_HOME`)*——属于宿主的全局指令机制,
381
+ 插件注入的是自己的工作流提示词。
382
+ - *实验性 Git Worktrees 插件*——上游的 agent 工作流特性;插件自己的
383
+ `git.use_worktree` 配置早于它,且是另一回事(iterate 循环的逐轮 git 卫生)。
384
+ - *移除 `both` 混合展示模式*——插件从未设置展示模式(用的是 `presentCall` 卡片),
385
+ 无需迁移。
386
+ - *从插件全局安装 dsh CLI*——运行时从不 shell 调用,纯占磁盘。
387
+ - 五个 `@deepseek-ai/*` 包全部精确锁到 `0.2.1-alpha.2`
388
+ (`@deepseek-ai/cordis` 保持 `4.0.5-alpha.1`)。无安装期生命周期脚本
329
389
  (`preinstall`/`install`/`postinstall`/`prepare`);仅 `prepublishOnly`(构建)在发布时运行。
330
390
 
331
391
  ### 失败边界
@@ -363,7 +423,7 @@ npm test
363
423
 
364
424
  所有测试通过:
365
425
 
366
- - **466 个单元测试全绿**,类型检查通过
426
+ - **全量单元测试 + 类型检查通过**(`npm test`、`npm run typecheck`——此处刻意不写具体数量以根除文档漂移,各版本量级见 `CHANGELOG.md`)
367
427
  - 覆盖:去重、过滤、排序、多轮收敛、meta-review 审计、路径安全、超时钳制、配置读写与回滚、triage 合并、diff 计算、checkpoint 校验、修复注册表、历史读取与过滤、prune 清理报告与 dry-run 语义、UI 纯函数(select-all 键、运行时状态指引)、**v3.2:经验银行、质量门禁、防御事件、审批门禁 fail-open 路径**等
368
428
 
369
429
  ---