patchwarden 0.6.1 → 1.1.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 (261) hide show
  1. package/PatchWarden-Control-Tray.cmd +11 -0
  2. package/PatchWarden-Control.cmd +6 -0
  3. package/PatchWarden-Desktop.cmd +5 -0
  4. package/PatchWarden.cmd +1 -1
  5. package/README.en.md +112 -24
  6. package/README.md +36 -25
  7. package/Restart-PatchWarden-Control.cmd +6 -0
  8. package/Stop-PatchWarden.cmd +11 -0
  9. package/dist/agents/agentRouter.d.ts +40 -0
  10. package/dist/agents/agentRouter.js +95 -0
  11. package/dist/config.d.ts +1 -1
  12. package/dist/config.js +6 -2
  13. package/dist/controlCenter.d.ts +14 -0
  14. package/dist/controlCenter.js +2015 -0
  15. package/dist/doctor.js +35 -4
  16. package/dist/goal/acceptanceEngine.d.ts +62 -0
  17. package/dist/goal/acceptanceEngine.js +103 -0
  18. package/dist/goal/acceptanceTemplate.d.ts +10 -0
  19. package/dist/goal/acceptanceTemplate.js +104 -0
  20. package/dist/goal/goalGraph.d.ts +58 -0
  21. package/dist/goal/goalGraph.js +189 -0
  22. package/dist/goal/goalProgress.d.ts +81 -0
  23. package/dist/goal/goalProgress.js +216 -0
  24. package/dist/goal/goalStatus.d.ts +60 -0
  25. package/dist/goal/goalStatus.js +137 -0
  26. package/dist/goal/goalStore.d.ts +79 -0
  27. package/dist/goal/goalStore.js +211 -0
  28. package/dist/goal/handoffExport.d.ts +34 -0
  29. package/dist/goal/handoffExport.js +183 -0
  30. package/dist/goal/subgoalSync.d.ts +40 -0
  31. package/dist/goal/subgoalSync.js +72 -0
  32. package/dist/goal/worktreeManager.d.ts +96 -0
  33. package/dist/goal/worktreeManager.js +292 -0
  34. package/dist/logging.d.ts +44 -0
  35. package/dist/logging.js +68 -0
  36. package/dist/release/releaseGate.d.ts +99 -0
  37. package/dist/release/releaseGate.js +475 -0
  38. package/dist/runner/postTaskCleanup.d.ts +13 -0
  39. package/dist/runner/postTaskCleanup.js +147 -0
  40. package/dist/runner/runTask.js +50 -10
  41. package/dist/security/discoveryTokenStore.d.ts +62 -0
  42. package/dist/security/discoveryTokenStore.js +100 -0
  43. package/dist/security/toolInvocationGuard.d.ts +35 -0
  44. package/dist/security/toolInvocationGuard.js +153 -0
  45. package/dist/smoke-test.js +18 -10
  46. package/dist/taskRuntime.d.ts +17 -0
  47. package/dist/test/unit/acceptance-engine.test.d.ts +1 -0
  48. package/dist/test/unit/acceptance-engine.test.js +228 -0
  49. package/dist/test/unit/agent-router.test.d.ts +1 -0
  50. package/dist/test/unit/agent-router.test.js +287 -0
  51. package/dist/test/unit/audit-checks.test.d.ts +1 -0
  52. package/dist/test/unit/audit-checks.test.js +350 -0
  53. package/dist/test/unit/diagnose-task.test.d.ts +1 -0
  54. package/dist/test/unit/diagnose-task.test.js +457 -0
  55. package/dist/test/unit/discovery-token-store.test.d.ts +1 -0
  56. package/dist/test/unit/discovery-token-store.test.js +139 -0
  57. package/dist/test/unit/goal-graph.test.d.ts +1 -0
  58. package/dist/test/unit/goal-graph.test.js +298 -0
  59. package/dist/test/unit/goal-progress.test.d.ts +1 -0
  60. package/dist/test/unit/goal-progress.test.js +381 -0
  61. package/dist/test/unit/goal-status.test.d.ts +1 -0
  62. package/dist/test/unit/goal-status.test.js +215 -0
  63. package/dist/test/unit/goal-store.test.d.ts +1 -0
  64. package/dist/test/unit/goal-store.test.js +253 -0
  65. package/dist/test/unit/goal-subgoal-task.test.d.ts +1 -0
  66. package/dist/test/unit/goal-subgoal-task.test.js +55 -0
  67. package/dist/test/unit/goal-tools-registry.test.d.ts +1 -0
  68. package/dist/test/unit/goal-tools-registry.test.js +190 -0
  69. package/dist/test/unit/handoff-export.test.d.ts +1 -0
  70. package/dist/test/unit/handoff-export.test.js +263 -0
  71. package/dist/test/unit/invoke-discovered-tool.test.d.ts +1 -0
  72. package/dist/test/unit/invoke-discovered-tool.test.js +167 -0
  73. package/dist/test/unit/logging.test.js +127 -5
  74. package/dist/test/unit/post-task-cleanup.test.d.ts +1 -0
  75. package/dist/test/unit/post-task-cleanup.test.js +48 -0
  76. package/dist/test/unit/reconcile-tasks.test.d.ts +1 -0
  77. package/dist/test/unit/reconcile-tasks.test.js +456 -0
  78. package/dist/test/unit/release-gate.test.d.ts +1 -0
  79. package/dist/test/unit/release-gate.test.js +242 -0
  80. package/dist/test/unit/safe-views.test.d.ts +1 -0
  81. package/dist/test/unit/safe-views.test.js +171 -0
  82. package/dist/test/unit/schema-drift-check.test.d.ts +1 -0
  83. package/dist/test/unit/schema-drift-check.test.js +175 -0
  84. package/dist/test/unit/subgoal-sync.test.d.ts +1 -0
  85. package/dist/test/unit/subgoal-sync.test.js +183 -0
  86. package/dist/test/unit/tool-invocation-guard.test.d.ts +1 -0
  87. package/dist/test/unit/tool-invocation-guard.test.js +432 -0
  88. package/dist/test/unit/tool-usage-stats.test.d.ts +1 -0
  89. package/dist/test/unit/tool-usage-stats.test.js +300 -0
  90. package/dist/test/unit/toolSearch.test.d.ts +1 -0
  91. package/dist/test/unit/toolSearch.test.js +571 -0
  92. package/dist/test/unit/worktree-manager.test.d.ts +1 -0
  93. package/dist/test/unit/worktree-manager.test.js +176 -0
  94. package/dist/tools/auditTask.d.ts +103 -1
  95. package/dist/tools/auditTask.js +461 -8
  96. package/dist/tools/cancelTask.js +1 -1
  97. package/dist/tools/checkReleaseGate.d.ts +21 -0
  98. package/dist/tools/checkReleaseGate.js +22 -0
  99. package/dist/tools/createTask.d.ts +18 -2
  100. package/dist/tools/createTask.js +29 -1
  101. package/dist/tools/diagnoseTask.d.ts +45 -0
  102. package/dist/tools/diagnoseTask.js +347 -0
  103. package/dist/tools/discardWorktree.d.ts +24 -0
  104. package/dist/tools/discardWorktree.js +27 -0
  105. package/dist/tools/discoverTools.d.ts +11 -0
  106. package/dist/tools/discoverTools.js +39 -0
  107. package/dist/tools/explainTool.d.ts +11 -0
  108. package/dist/tools/explainTool.js +21 -0
  109. package/dist/tools/getTaskSummary.js +2 -1
  110. package/dist/tools/goalSubgoalTask.d.ts +51 -0
  111. package/dist/tools/goalSubgoalTask.js +110 -0
  112. package/dist/tools/healthCheck.d.ts +1 -0
  113. package/dist/tools/healthCheck.js +5 -1
  114. package/dist/tools/invokeDiscoveredTool.d.ts +37 -0
  115. package/dist/tools/invokeDiscoveredTool.js +112 -0
  116. package/dist/tools/listTasks.d.ts +3 -1
  117. package/dist/tools/listTasks.js +14 -1
  118. package/dist/tools/mergeWorktree.d.ts +24 -0
  119. package/dist/tools/mergeWorktree.js +27 -0
  120. package/dist/tools/reconcileTasks.d.ts +41 -0
  121. package/dist/tools/reconcileTasks.js +352 -0
  122. package/dist/tools/registry.js +550 -0
  123. package/dist/tools/safeStatus.d.ts +31 -1
  124. package/dist/tools/safeStatus.js +43 -1
  125. package/dist/tools/safeViews.d.ts +256 -0
  126. package/dist/tools/safeViews.js +250 -0
  127. package/dist/tools/schemaDriftCheck.d.ts +46 -0
  128. package/dist/tools/schemaDriftCheck.js +80 -0
  129. package/dist/tools/toolCatalog.d.ts +4 -3
  130. package/dist/tools/toolCatalog.js +33 -11
  131. package/dist/tools/toolRegistry.d.ts +61 -0
  132. package/dist/tools/toolRegistry.js +724 -0
  133. package/dist/tools/toolSearch.d.ts +110 -0
  134. package/dist/tools/toolSearch.js +331 -0
  135. package/dist/tools/toolUsageStats.d.ts +41 -0
  136. package/dist/tools/toolUsageStats.js +116 -0
  137. package/dist/tools/waitForTask.js +1 -0
  138. package/dist/version.d.ts +2 -2
  139. package/dist/version.js +2 -2
  140. package/dist/watcherStatus.d.ts +29 -0
  141. package/dist/watcherStatus.js +92 -1
  142. package/docs/control-center/README.md +33 -0
  143. package/docs/control-center/control-center-daily-driver.md +211 -0
  144. package/docs/control-center/control-center-mvp.md +205 -0
  145. package/docs/control-center/control-center-phase2.md +159 -0
  146. package/docs/demo.md +3 -0
  147. package/docs/release-v0.6.4.md +45 -0
  148. package/examples/openai-tunnel/README.md +5 -5
  149. package/examples/openai-tunnel/tunnel-client.example.yaml +3 -3
  150. package/package.json +25 -16
  151. package/scripts/README.md +47 -0
  152. package/scripts/{brand-check.js → checks/brand-check.js} +2 -2
  153. package/scripts/checks/control-center-smoke.js +1098 -0
  154. package/scripts/{control-smoke.js → checks/control-smoke.js} +19 -5
  155. package/scripts/{doctor-smoke.js → checks/doctor-smoke.js} +2 -1
  156. package/scripts/{http-mcp-smoke.js → checks/http-mcp-smoke.js} +2 -2
  157. package/scripts/{lifecycle-smoke.js → checks/lifecycle-smoke.js} +25 -21
  158. package/scripts/{mcp-manifest-check.js → checks/mcp-manifest-check.js} +54 -7
  159. package/scripts/{mcp-smoke.js → checks/mcp-smoke.js} +40 -11
  160. package/scripts/{package-manifest-check.js → checks/package-manifest-check.js} +2 -1
  161. package/scripts/{tunnel-supervisor-smoke.js → checks/tunnel-supervisor-smoke.js} +2 -2
  162. package/scripts/{unit-tests.js → checks/unit-tests.js} +1 -1
  163. package/scripts/{watcher-supervisor-smoke.js → checks/watcher-supervisor-smoke.js} +13 -7
  164. package/scripts/control/control-center-tray.ps1 +281 -0
  165. package/scripts/{get-patchwarden-health.ps1 → control/get-patchwarden-health.ps1} +3 -3
  166. package/scripts/{manage-patchwarden.ps1 → control/manage-patchwarden.ps1} +30 -4
  167. package/scripts/control/restart-control-center.ps1 +173 -0
  168. package/scripts/{restart-patchwarden.ps1 → control/restart-patchwarden.ps1} +1 -1
  169. package/scripts/control/start-control-center.ps1 +263 -0
  170. package/scripts/{start-patchwarden-tunnel.ps1 → control/start-patchwarden-tunnel.ps1} +48 -6
  171. package/scripts/control/stop-patchwarden.ps1 +114 -0
  172. package/scripts/launchers/Check-PatchWarden-Health.cmd +1 -1
  173. package/scripts/launchers/Reset-PatchWarden-Tunnel-Key.cmd +1 -1
  174. package/scripts/launchers/Restart-PatchWarden.cmd +1 -1
  175. package/scripts/launchers/Start-PatchWarden-Direct-Tunnel.cmd +1 -1
  176. package/scripts/launchers/Start-PatchWarden-Tunnel.cmd +1 -1
  177. package/scripts/{patchwarden-mcp-direct.cmd → mcp/patchwarden-mcp-direct.cmd} +1 -1
  178. package/scripts/{patchwarden-mcp-stdio.cmd → mcp/patchwarden-mcp-stdio.cmd} +1 -1
  179. package/scripts/{pack-clean.js → release/pack-clean.js} +9 -1
  180. package/src/agents/agentRouter.ts +149 -0
  181. package/src/config.ts +9 -3
  182. package/src/controlCenter.ts +2166 -0
  183. package/src/doctor.ts +40 -5
  184. package/src/goal/acceptanceEngine.ts +160 -0
  185. package/src/goal/acceptanceTemplate.ts +121 -0
  186. package/src/goal/goalGraph.ts +225 -0
  187. package/src/goal/goalProgress.ts +301 -0
  188. package/src/goal/goalStatus.ts +234 -0
  189. package/src/goal/goalStore.ts +306 -0
  190. package/src/goal/handoffExport.ts +211 -0
  191. package/src/goal/subgoalSync.ts +82 -0
  192. package/src/goal/worktreeManager.ts +404 -0
  193. package/src/logging.ts +91 -0
  194. package/src/release/releaseGate.ts +567 -0
  195. package/src/runner/postTaskCleanup.ts +154 -0
  196. package/src/runner/runTask.ts +49 -10
  197. package/src/security/discoveryTokenStore.ts +157 -0
  198. package/src/security/toolInvocationGuard.ts +251 -0
  199. package/src/smoke-test.ts +15 -7
  200. package/src/taskRuntime.ts +17 -0
  201. package/src/test/unit/acceptance-engine.test.ts +261 -0
  202. package/src/test/unit/agent-router.test.ts +342 -0
  203. package/src/test/unit/audit-checks.test.ts +567 -0
  204. package/src/test/unit/diagnose-task.test.ts +544 -0
  205. package/src/test/unit/discovery-token-store.test.ts +181 -0
  206. package/src/test/unit/goal-graph.test.ts +347 -0
  207. package/src/test/unit/goal-progress.test.ts +538 -0
  208. package/src/test/unit/goal-status.test.ts +270 -0
  209. package/src/test/unit/goal-store.test.ts +318 -0
  210. package/src/test/unit/goal-subgoal-task.test.ts +72 -0
  211. package/src/test/unit/goal-tools-registry.test.ts +243 -0
  212. package/src/test/unit/handoff-export.test.ts +295 -0
  213. package/src/test/unit/invoke-discovered-tool.test.ts +216 -0
  214. package/src/test/unit/logging.test.ts +177 -5
  215. package/src/test/unit/post-task-cleanup.test.ts +53 -0
  216. package/src/test/unit/reconcile-tasks.test.ts +551 -0
  217. package/src/test/unit/release-gate.test.ts +314 -0
  218. package/src/test/unit/safe-views.test.ts +184 -0
  219. package/src/test/unit/schema-drift-check.test.ts +258 -0
  220. package/src/test/unit/subgoal-sync.test.ts +236 -0
  221. package/src/test/unit/tool-invocation-guard.test.ts +542 -0
  222. package/src/test/unit/tool-usage-stats.test.ts +384 -0
  223. package/src/test/unit/toolSearch.test.ts +756 -0
  224. package/src/test/unit/worktree-manager.test.ts +247 -0
  225. package/src/tools/auditTask.ts +831 -402
  226. package/src/tools/cancelTask.ts +1 -1
  227. package/src/tools/checkReleaseGate.ts +45 -0
  228. package/src/tools/createTask.ts +64 -6
  229. package/src/tools/diagnoseTask.ts +460 -0
  230. package/src/tools/discardWorktree.ts +42 -0
  231. package/src/tools/discoverTools.ts +51 -0
  232. package/src/tools/explainTool.ts +26 -0
  233. package/src/tools/getTaskSummary.ts +2 -1
  234. package/src/tools/goalSubgoalTask.ts +170 -0
  235. package/src/tools/healthCheck.ts +4 -1
  236. package/src/tools/invokeDiscoveredTool.ts +163 -0
  237. package/src/tools/listTasks.ts +16 -2
  238. package/src/tools/mergeWorktree.ts +42 -0
  239. package/src/tools/reconcileTasks.ts +464 -0
  240. package/src/tools/registry.ts +618 -1
  241. package/src/tools/safeStatus.ts +73 -2
  242. package/src/tools/safeViews.ts +271 -0
  243. package/src/tools/schemaDriftCheck.ts +120 -0
  244. package/src/tools/toolCatalog.ts +34 -11
  245. package/src/tools/toolRegistry.ts +786 -0
  246. package/src/tools/toolSearch.ts +464 -0
  247. package/src/tools/toolUsageStats.ts +151 -0
  248. package/src/tools/waitForTask.ts +1 -0
  249. package/src/version.ts +2 -2
  250. package/src/watcherStatus.ts +97 -1
  251. package/ui/colors_and_type.css +141 -0
  252. package/ui/pages/audit.html +743 -0
  253. package/ui/pages/dashboard.html +1154 -0
  254. package/ui/pages/direct-sessions.html +652 -0
  255. package/ui/pages/logs.html +502 -0
  256. package/ui/pages/task-detail.html +1229 -0
  257. package/ui/pages/tasks.html +702 -0
  258. package/ui/pages/workspace.html +947 -0
  259. package/ui/partials/project-shell.html +362 -0
  260. package/ui/vendor/lucide.js +12 -0
  261. package/ui/vendor/tailwindcss-browser.js +947 -0
@@ -0,0 +1,11 @@
1
+ @echo off
2
+ setlocal
3
+ cd /d "%~dp0"
4
+ if /i "%~1"=="--foreground" (
5
+ powershell.exe -NoProfile -ExecutionPolicy Bypass -File "%~dp0scripts\control\control-center-tray.ps1" %*
6
+ set EXITCODE=%ERRORLEVEL%
7
+ endlocal & exit /b %EXITCODE%
8
+ )
9
+
10
+ start "" powershell.exe -NoProfile -ExecutionPolicy Bypass -WindowStyle Hidden -File "%~dp0scripts\control\control-center-tray.ps1" %*
11
+ endlocal & exit /b 0
@@ -0,0 +1,6 @@
1
+ @echo off
2
+ setlocal
3
+ cd /d "%~dp0"
4
+ powershell -ExecutionPolicy Bypass -NoProfile -File "%~dp0scripts\control\start-control-center.ps1" %*
5
+ set EXITCODE=%ERRORLEVEL%
6
+ endlocal & exit /b %EXITCODE%
@@ -0,0 +1,5 @@
1
+ @echo off
2
+ setlocal
3
+ cd /d "%~dp0"
4
+ start "" powershell.exe -NoProfile -ExecutionPolicy Bypass -WindowStyle Hidden -File "%~dp0scripts\control\control-center-tray.ps1" %*
5
+ endlocal & exit /b 0
package/PatchWarden.cmd CHANGED
@@ -20,7 +20,7 @@ set "HTTPS_PROXY=%PATCHWARDEN_PROXY_URL%"
20
20
  set "ALL_PROXY=%PATCHWARDEN_PROXY_URL%"
21
21
  set "NO_PROXY=localhost,127.0.0.1,::1"
22
22
 
23
- set "SCRIPTS_DIR=%~dp0scripts"
23
+ set "SCRIPTS_DIR=%~dp0scripts\control"
24
24
  set "MANAGER=%SCRIPTS_DIR%\manage-patchwarden.ps1"
25
25
 
26
26
  if not exist "%MANAGER%" (
package/README.en.md CHANGED
@@ -8,16 +8,18 @@
8
8
  [![Node.js](https://img.shields.io/badge/Node.js-%3E%3D18-339933.svg)](https://nodejs.org/)
9
9
  [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
10
10
 
11
- Current stable release: **v0.6.0**. See the
12
- [release notes](docs/release-v0.6.0.md),
13
- [migration guide](docs/migration-from-safe-bifrost.md), and
14
- [GitHub Release](https://github.com/jiezeng2004-design/PatchWarden/releases/tag/v0.6.0).
11
+ Current source version: **v1.1.0**. See the
12
+ [CHANGELOG](CHANGELOG.md), [migration guide](docs/migration-from-safe-bifrost.md), and
13
+ [release checklist](docs/release-checklist.md). Verify GitHub Release / npm publication separately before release.
15
14
 
16
- PatchWarden is a security-focused MCP bridge for local coding agents.
17
- ChatGPT, Codex, OpenCode, or another MCP client can plan and review work;
15
+ PatchWarden is a local-first MCP safety and verification layer for AI coding
16
+ agents, with workspace confinement, command allowlists, scope-violation
17
+ detection, and auditable task evidence.
18
+
19
+ ChatGPT, Codex, OpenCode, or another MCP client can plan and review work.
18
20
  PatchWarden stores that plan as a workspace-scoped task, lets a preconfigured
19
- local agent execute it, and returns results, diffs, and independent
20
- verification evidence.
21
+ local agent execute it, and returns results, diffs, artifact manifests, and
22
+ independent verification evidence.
21
23
 
22
24
  ![PatchWarden ChatGPT connector demo](docs/assets/patchwarden-chatgpt-demo.svg)
23
25
 
@@ -30,6 +32,8 @@ verification evidence.
30
32
  ## Contents
31
33
 
32
34
  - [What PatchWarden solves](#what-patchwarden-solves)
35
+ - [How PatchWarden differs](#how-patchwarden-differs)
36
+ - [Evidence example](#evidence-example)
33
37
  - [Runtime architecture](#runtime-architecture)
34
38
  - [Requirements](#requirements)
35
39
  - [Five-minute quick start](#five-minute-quick-start)
@@ -77,6 +81,83 @@ PatchWarden is not designed for:
77
81
  - Managing an entire drive, home directory, or directory full of private data.
78
82
  - Unattended commits, pushes, releases, or production changes.
79
83
 
84
+ ## How PatchWarden differs
85
+
86
+ PatchWarden sits between an MCP client and local coding tools. It is not a
87
+ replacement for every adjacent layer:
88
+
89
+ | Layer | Primary job | PatchWarden's role |
90
+ | --- | --- | --- |
91
+ | Sandbox | Isolate a process or filesystem at runtime. | Add task-level policy, evidence, verification, and review records around local agent work. |
92
+ | Coding agent | Edit code and run local tools. | Launch only preconfigured agents with trusted argument templates and bounded repositories. |
93
+ | Generic MCP server | Expose tools to an MCP client. | Expose a constrained task workflow instead of a broad shell or arbitrary filesystem access. |
94
+
95
+ The first reusable capability to evaluate independently is:
96
+
97
+ > Artifact manifest + verified completion evidence
98
+
99
+ This capability is intentionally small: a task can finish with structured
100
+ status, changed-file groups, release-artifact metadata, verification records,
101
+ and scope-violation evidence in JSON. Other projects can inspect or adapt that
102
+ evidence model without adopting PatchWarden's full runtime.
103
+
104
+ ## Evidence example
105
+
106
+ A completed task writes bounded, reviewable artifacts under
107
+ `.patchwarden/tasks/<task_id>/`. The high-signal files are:
108
+
109
+ - `result.json` - final status, verification status, changed-file groups, and warnings.
110
+ - `artifact_manifest.json` - generated artifacts with size, type, and SHA-256.
111
+ - `verify.json` - exact verification commands and exit codes.
112
+ - `diff.patch` - complete source diff when Git evidence is available.
113
+ - `rollback_scope_violation_plan.md` - review plan when a task changes files outside `repo_path`.
114
+
115
+ Example compact evidence:
116
+
117
+ ```json
118
+ {
119
+ "task_id": "task_20260625_010513_ad59bb",
120
+ "status": "done",
121
+ "verify_status": "passed",
122
+ "changed_file_groups": {
123
+ "source_changes": 2,
124
+ "docs_changes": 1,
125
+ "config_changes": 0,
126
+ "test_changes": 1,
127
+ "release_artifacts": 1,
128
+ "runtime_generated_files": 0
129
+ },
130
+ "artifact_status": "collected",
131
+ "artifact_manifest": {
132
+ "artifacts": [
133
+ {
134
+ "path": "release/app.zip",
135
+ "type": "zip",
136
+ "size": 467725,
137
+ "sha256": "03731a12990718325d3cb9ecdc9dbc899fc840e8ef6e2de3e810577999b5f864"
138
+ }
139
+ ]
140
+ },
141
+ "new_out_of_scope_changes": []
142
+ }
143
+ ```
144
+
145
+
146
+ A scope violation remains explicit:
147
+
148
+ ```json
149
+ {
150
+ "status": "failed_scope_violation",
151
+ "verify_status": "failed",
152
+ "new_out_of_scope_changes": [
153
+ {
154
+ "path": "external/external-renamed.txt",
155
+ "change": "modified"
156
+ }
157
+ ]
158
+ }
159
+ ```
160
+
80
161
  ## Runtime architecture
81
162
 
82
163
  ```text
@@ -184,7 +265,7 @@ execution still requires a separate Watcher.
184
265
  New-Item -ItemType Directory .\patchwarden-runtime
185
266
  Set-Location .\patchwarden-runtime
186
267
  npm.cmd init -y
187
- npm.cmd install patchwarden@0.6.0
268
+ npm.cmd install patchwarden@<published-version>
188
269
  Copy-Item .\node_modules\patchwarden\examples\config.example.json .\patchwarden.config.json
189
270
  $env:PATCHWARDEN_CONFIG = (Resolve-Path .\patchwarden.config.json)
190
271
  node .\node_modules\patchwarden\dist\runner\watch.js
@@ -193,10 +274,10 @@ node .\node_modules\patchwarden\dist\runner\watch.js
193
274
  An MCP client can launch:
194
275
 
195
276
  ```text
196
- npx.cmd -y patchwarden@0.6.0
277
+ npx.cmd -y patchwarden@<published-version>
197
278
  ```
198
279
 
199
- Pin the version in important environments instead of using `latest`
280
+ Replace `<published-version>` with a version that exists on npm/GitHub, and pin that version in important environments instead of using `latest`
200
281
  unconditionally.
201
282
 
202
283
  ## Complete configuration guide
@@ -249,7 +330,7 @@ Configuration fields:
249
330
  | `workspaceRoot` | Yes | The only workspace root PatchWarden may access. |
250
331
  | `plansDir` | Yes | Plan directory, normally `.patchwarden/plans`. |
251
332
  | `tasksDir` | Yes | Task and result directory, normally `.patchwarden/tasks`. |
252
- | `toolProfile` | No | `full` or `chatgpt_core`; use `full` for local clients. |
333
+ | `toolProfile` | No | `full`, `chatgpt_core`, `chatgpt_direct`, or `chatgpt_search`; use `full` for local clients and `chatgpt_search` for compact discovery-driven clients. |
253
334
  | `agents` | Yes | Execution-agent allowlist; supports `{repo}` and `{prompt}` placeholders. |
254
335
  | `allowedTestCommands` | Yes | Exact allowlist for independent verification commands. |
255
336
  | `repoAllowedTestCommands` | No | Extra exact commands keyed by workspace-relative repository path; wildcards are unsupported. |
@@ -352,7 +433,7 @@ Pinned npm configuration:
352
433
  ```toml
353
434
  [mcp_servers.patchwarden]
354
435
  command = "npx.cmd"
355
- args = ["-y", "patchwarden@0.6.0"]
436
+ args = ["-y", "patchwarden@<published-version>"]
356
437
 
357
438
  [mcp_servers.patchwarden.env]
358
439
  PATCHWARDEN_CONFIG = "D:\\path\\to\\patchwarden.config.json"
@@ -412,7 +493,7 @@ PatchWarden.cmd start core
412
493
  The launcher:
413
494
 
414
495
  - Builds `dist/index.js` if it is missing.
415
- - Verifies v0.6.0, the fixed 16-tool `chatgpt_core` catalog, and its schema
496
+ - Verifies v1.1.0, the fixed 21-tool `chatgpt_core` catalog, and its schema
416
497
  manifest.
417
498
  - Reads or prompts for the Tunnel ID.
418
499
  - Reads or prompts for the runtime API key.
@@ -446,7 +527,7 @@ the expanded tunnel examples.
446
527
 
447
528
  ### Launcher default
448
529
 
449
- `scripts/start-patchwarden-tunnel.ps1` first reads `HTTPS_PROXY` from the
530
+ `scripts/control/start-patchwarden-tunnel.ps1` first reads `HTTPS_PROXY` from the
450
531
  current process. If it is absent, the launcher defaults to:
451
532
 
452
533
  ```text
@@ -606,6 +687,7 @@ mean the task is wrong.
606
687
  | `result.md` | Human-readable execution report. |
607
688
  | `result.json` | Structured result, paths, changes, warnings, and next steps. |
608
689
  | `diff.patch` | Complete task change evidence. |
690
+ | `artifact_manifest.json` | Generated artifact paths, types, sizes, and SHA-256 hashes. |
609
691
  | `file-stats.json` | Per-file addition and deletion statistics. |
610
692
  | `verify.json` | Structured record for every independent verification command. |
611
693
  | `verify.log` | Human-readable independent verification output. |
@@ -659,7 +741,7 @@ Optional token configuration:
659
741
  Set the token in the PowerShell process that starts the server:
660
742
 
661
743
  ```powershell
662
- $env:PATCHWARDEN_OWNER_TOKEN = "use-a-random-local-only-value"
744
+ $env:PATCHWARDEN_OWNER_TOKEN = "<token>"
663
745
  ```
664
746
 
665
747
  Clients can send `Authorization: Bearer ...` or `x-patchwarden-token`. Never
@@ -695,8 +777,11 @@ available from PowerShell:
695
777
  .\PatchWarden.cmd restart all
696
778
  .\PatchWarden.cmd status all
697
779
  .\PatchWarden.cmd kill all
780
+ .\Stop-PatchWarden.cmd
698
781
  ```
699
782
 
783
+ For daily desktop use, start with `PatchWarden-Desktop.cmd`; it starts the tray and keeps Control Center available without opening extra browser windows. Use `PatchWarden-Control-Tray.cmd --foreground` only for tray debugging, `PatchWarden-Control.cmd` for the full local Web dashboard, and `Stop-PatchWarden.cmd` for one-click shutdown of Core/Direct, Control Center, and the tray.
784
+
700
785
  The old single-purpose launchers remain under `scripts/launchers/` as a
701
786
  compatibility layer. Personal launchers live under `.local/launchers/` and
702
787
  remain excluded from Git and release packages. `stop` and `restart` correlate
@@ -768,7 +853,7 @@ terminate unrelated PatchWarden, OpenCode, or Codex instances.
768
853
  | --- | --- | --- |
769
854
  | Tunnel connection keeps timing out | No proxy is listening on default port 7892 | Find the real HTTP/Mixed port, set `HTTPS_PROXY`, and start from the same terminal. |
770
855
  | Logs show 403 and `unsupported_country_region_territory` | Unsupported proxy exit region | Switch exit region and restart the tunnel. |
771
- | `list_workspace` only shows `tunnel-client.exe` | MCP started in the wrong directory or did not receive the config path | Use `scripts/patchwarden-mcp-stdio.cmd`. |
856
+ | `list_workspace` only shows `tunnel-client.exe` | MCP started in the wrong directory or did not receive the config path | Use `scripts/mcp/patchwarden-mcp-stdio.cmd`. |
772
857
  | MCP is connected, but tasks do not run | Watcher is missing or stale | Start `npm.cmd run watch` and inspect `health_check`. |
773
858
  | `Agent command not found` | Agent is not on PATH, or Codex Desktop was mistaken for the CLI | Run `where.exe` and use the real CLI path in `agents.command`. |
774
859
  | Verification command is rejected | It does not exactly match the allowlist | Add the exact command to `allowedTestCommands`. |
@@ -845,13 +930,13 @@ names.
845
930
 
846
931
  ## MCP tools and profiles
847
932
 
848
- `chatgpt_core` is the fixed 16-tool profile used by the ChatGPT tunnel:
933
+ `chatgpt_core` is the fixed 21-tool profile used by the ChatGPT tunnel:
849
934
 
850
935
  `health_check`, `list_agents`, `list_workspace`,
851
936
  `read_workspace_file`, `save_plan`, `create_task`,
852
937
  `wait_for_task`, `get_task_summary`, `get_diff`, `get_result`,
853
938
  `get_result_json`, `get_test_log`, `get_task_status`, `list_tasks`,
854
- `cancel_task`, and `audit_task`.
939
+ `cancel_task`, `audit_task`, `safe_status`, `safe_result`, `safe_audit`, `safe_test_summary`, and `safe_diff_summary`.
855
940
 
856
941
  `get_task_summary` keeps the backward-compatible `standard` view by default.
857
942
  ChatGPT should request `view: "compact"` first; terminal `wait_for_task`
@@ -871,7 +956,7 @@ to `full`.
871
956
 
872
957
  ### ChatGPT Direct mode
873
958
 
874
- Direct mode exposes nine guarded tools so ChatGPT can create an editing
959
+ Direct mode exposes thirteen guarded tools so ChatGPT can create an editing
875
960
  session, read and search source files, apply hash-bound JSON patches, run
876
961
  exactly allowlisted verification commands, finalize the evidence, and audit
877
962
  the result without a local execution agent.
@@ -895,7 +980,7 @@ On first use, provide the `tunnel-client.exe` path and a Tunnel ID dedicated
895
980
  to the Direct Connector. The launcher uses the `patchwarden-direct` profile,
896
981
  stores runtime state under `%LOCALAPPDATA%\patchwarden\runtime-direct`, skips
897
982
  the Watcher, and retains the existing DPAPI credential handling. In a fresh
898
- ChatGPT conversation, `health_check` should report `chatgpt_direct`, nine
983
+ ChatGPT conversation, `health_check` should report `chatgpt_direct`, thirteen
899
984
  tools, and `direct_profile_enabled=true`.
900
985
 
901
986
  ## Security boundaries and local data
@@ -931,7 +1016,7 @@ Start with a dedicated test workspace and a repository you can recover.
931
1016
  Upgrade a pinned npm installation:
932
1017
 
933
1018
  ```powershell
934
- npm.cmd install patchwarden@0.6.0
1019
+ npm.cmd install patchwarden@<published-version>
935
1020
  ```
936
1021
 
937
1022
  Upgrade a source checkout:
@@ -997,6 +1082,8 @@ and release-asset checksums independently.
997
1082
 
998
1083
  ## Related documentation
999
1084
 
1085
+ - [v0.6.4 release notes](docs/release-v0.6.4.md)
1086
+ - [v0.6.1 release notes](docs/release-v0.6.1.md)
1000
1087
  - [v0.6.0 release notes](docs/release-v0.6.0.md)
1001
1088
  - [ChatGPT usage guide](docs/chatgpt-usage.md)
1002
1089
  - [Migration guide](docs/migration-from-safe-bifrost.md)
@@ -1013,8 +1100,9 @@ and release-asset checksums independently.
1013
1100
  - [x] ChatGPT Connector / tunnel
1014
1101
  - [x] Doctor and runtime health checks
1015
1102
  - [x] Tool manifest and schema-drift detection
1016
- - [ ] Worktree isolation
1017
- - [ ] Multi-agent task queue
1103
+ - [x] Release Gate (five-stage pre-release verification)
1104
+ - [x] Worktree isolation
1105
+ - [x] Multi-agent routing
1018
1106
  - [ ] Local dashboard
1019
1107
 
1020
1108
  ## License
package/README.md CHANGED
@@ -8,16 +8,19 @@
8
8
  [![Node.js](https://img.shields.io/badge/Node.js-%3E%3D18-339933.svg)](https://nodejs.org/)
9
9
  [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
10
10
 
11
- 当前稳定版本:**v0.6.1**。查看
12
- [发布说明](docs/release-v0.6.1.md)
13
- [迁移指南](docs/migration-from-safe-bifrost.md)
14
- [GitHub Release](https://github.com/jiezeng2004-design/PatchWarden/releases/tag/v0.6.1)。
11
+ 当前源码版本:**v1.1.0**。查看
12
+ [CHANGELOG](CHANGELOG.md)、[迁移指南](docs/migration-from-safe-bifrost.md)
13
+ [发布检查清单](docs/release-checklist.md)。GitHub Release / npm 发布状态需要在发布前单独核对。
15
14
 
16
15
  PatchWarden 是一个面向本地编程 Agent 的安全 MCP 桥接器。上游的
17
16
  ChatGPT、Codex、OpenCode 或其他 MCP 客户端负责规划与验收,
18
17
  PatchWarden 负责把计划保存成工作区内任务,再由预先配置的本地 Agent
19
18
  执行,并返回结果、代码差异和独立测试记录。
20
19
 
20
+ 统一英文定位:
21
+
22
+ > PatchWarden is a local-first MCP safety and verification layer for AI coding agents, with workspace confinement, command allowlists, scope-violation detection, and auditable task evidence.
23
+
21
24
  ![PatchWarden ChatGPT connector demo](docs/assets/patchwarden-chatgpt-demo.svg)
22
25
 
23
26
  > [!IMPORTANT]
@@ -96,6 +99,7 @@ ChatGPT / Codex / OpenCode / 其他 MCP 客户端
96
99
  MCP 客户端读取、审计、人工验收
97
100
  ```
98
101
 
102
+
99
103
  一次完整运行通常包含三个角色:
100
104
 
101
105
  1. **MCP Server**:由 Codex、OpenCode 或 Tunnel 启动。
@@ -175,7 +179,7 @@ npm 包适合让 MCP 客户端通过固定版本启动 PatchWarden。为了执
175
179
  New-Item -ItemType Directory .\patchwarden-runtime
176
180
  Set-Location .\patchwarden-runtime
177
181
  npm.cmd init -y
178
- npm.cmd install patchwarden@0.6.0
182
+ npm.cmd install patchwarden@<published-version>
179
183
  Copy-Item .\node_modules\patchwarden\examples\config.example.json .\patchwarden.config.json
180
184
  $env:PATCHWARDEN_CONFIG = (Resolve-Path .\patchwarden.config.json)
181
185
  node .\node_modules\patchwarden\dist\runner\watch.js
@@ -184,10 +188,10 @@ node .\node_modules\patchwarden\dist\runner\watch.js
184
188
  MCP 客户端可以使用:
185
189
 
186
190
  ```text
187
- npx.cmd -y patchwarden@0.6.0
191
+ npx.cmd -y patchwarden@<published-version>
188
192
  ```
189
193
 
190
- 建议固定版本号,不要在重要环境中无条件使用 `latest`。
194
+ `<published-version>` 替换为已经在 npm/GitHub 上确认存在的版本;不要在重要环境中无条件使用 `latest`。
191
195
 
192
196
  ## 完整配置说明
193
197
 
@@ -239,7 +243,7 @@ Copy-Item .\examples\config.example.json .\patchwarden.config.json
239
243
  | `workspaceRoot` | 是 | PatchWarden 唯一允许访问的工作区根目录。 |
240
244
  | `plansDir` | 是 | 计划目录,通常使用 `.patchwarden/plans`。 |
241
245
  | `tasksDir` | 是 | 任务和结果目录,通常使用 `.patchwarden/tasks`。 |
242
- | `toolProfile` | 否 | `full` 或 `chatgpt_core`;本地客户端推荐 `full`。 |
246
+ | `toolProfile` | 否 | `full`、`chatgpt_core`、`chatgpt_direct` 或 `chatgpt_search`;本地客户端推荐 `full`,动态工具发现场景使用 `chatgpt_search`。 |
243
247
  | `agents` | 是 | 可执行 Agent 白名单;支持 `{repo}` 和 `{prompt}` 占位符。 |
244
248
  | `allowedTestCommands` | 是 | 独立验证命令白名单,调用时必须精确匹配。 |
245
249
  | `repoAllowedTestCommands` | 否 | 按工作区相对仓库路径增加精确验证命令;不支持通配符。 |
@@ -337,7 +341,7 @@ npm.cmd run watch
337
341
  ```toml
338
342
  [mcp_servers.patchwarden]
339
343
  command = "npx.cmd"
340
- args = ["-y", "patchwarden@0.6.0"]
344
+ args = ["-y", "patchwarden@<published-version>"]
341
345
 
342
346
  [mcp_servers.patchwarden.env]
343
347
  PATCHWARDEN_CONFIG = "D:\\path\\to\\patchwarden.config.json"
@@ -395,7 +399,7 @@ PatchWarden.cmd start core
395
399
  启动器会:
396
400
 
397
401
  - 检查 `dist/index.js`,缺失时自动构建。
398
- - 校验 `chatgpt_core` 的版本、16 个核心工具和 Schema Manifest。
402
+ - 校验 `chatgpt_core` 的版本、21 个核心工具和 Schema Manifest。
399
403
  - 读取或提示输入 Tunnel ID。
400
404
  - 读取或提示输入运行时 API Key。
401
405
  - 使用 Windows DPAPI 保存凭据到 `%APPDATA%\patchwarden`。
@@ -426,7 +430,7 @@ ChatGPT Connector 创建时:
426
430
 
427
431
  ### 一键脚本的默认值
428
432
 
429
- `scripts/start-patchwarden-tunnel.ps1` 优先读取当前进程的
433
+ `scripts/control/start-patchwarden-tunnel.ps1` 优先读取当前进程的
430
434
  `HTTPS_PROXY`。如果没有设置,它会默认使用:
431
435
 
432
436
  ```text
@@ -568,6 +572,7 @@ ChatGPT 任务应优先选择前三个守护模板:只读诊断使用 `inspect
568
572
  | `result.md` | 人类可读的执行报告。 |
569
573
  | `result.json` | 结构化结果、路径、变更、警告和后续建议。 |
570
574
  | `diff.patch` | 完整任务差异证据。 |
575
+ | `artifact_manifest.json` | 构建或发布产物的路径、类型、大小与 SHA-256。 |
571
576
  | `file-stats.json` | 文件级增删统计。 |
572
577
  | `verify.json` | 每条独立验证命令的结构化记录。 |
573
578
  | `verify.log` | 独立验证的可读日志。 |
@@ -653,8 +658,11 @@ Direct 两种模式的启动、停止、重启与状态。也可以在 PowerShel
653
658
  .\PatchWarden.cmd restart all
654
659
  .\PatchWarden.cmd status all
655
660
  .\PatchWarden.cmd kill all
661
+ .\Stop-PatchWarden.cmd
656
662
  ```
657
663
 
664
+ 日常桌面入口:`PatchWarden-Desktop.cmd` 启动托盘并确保 Control Center 可用,不自动打开额外浏览器窗口。只有调试托盘时才使用 `PatchWarden-Control-Tray.cmd --foreground`;需要完整 Web 控制台时打开 `PatchWarden-Control.cmd`;需要一键收尾时使用 `Stop-PatchWarden.cmd` 关闭 Core/Direct、Control Center 和托盘。
665
+
658
666
  旧的单用途入口保留在 `scripts/launchers/` 作为兼容层;个人入口位于
659
667
  `.local/launchers/`,并继续被 Git 和发布包排除。`stop` / `restart` 会同时检查
660
668
  运行状态、精确的 Tunnel Profile、项目启动器和进程树,因此可以清理同一 Profile
@@ -726,13 +734,13 @@ Core Agent 和 Direct 可以**同时运行**,使用不同的 `tunnel-client` p
726
734
  **Core 启动示例:**
727
735
 
728
736
  ```cmd
729
- powershell.exe -NoProfile -ExecutionPolicy Bypass -File "%CD%\scripts\start-patchwarden-tunnel.ps1" -ToolProfile chatgpt_core -Profile patchwarden -HealthListenAddr 127.0.0.1:8080
737
+ powershell.exe -NoProfile -ExecutionPolicy Bypass -File "%CD%\scripts\control\start-patchwarden-tunnel.ps1" -ToolProfile chatgpt_core -Profile patchwarden -HealthListenAddr 127.0.0.1:8080
730
738
  ```
731
739
 
732
740
  **Direct 启动示例:**
733
741
 
734
742
  ```cmd
735
- powershell.exe -NoProfile -ExecutionPolicy Bypass -File "%CD%\scripts\start-patchwarden-tunnel.ps1" -ToolProfile chatgpt_direct -Profile patchwarden-direct -HealthListenAddr 127.0.0.1:8081 -SkipWatcher
743
+ powershell.exe -NoProfile -ExecutionPolicy Bypass -File "%CD%\scripts\control\start-patchwarden-tunnel.ps1" -ToolProfile chatgpt_direct -Profile patchwarden-direct -HealthListenAddr 127.0.0.1:8081 -SkipWatcher
736
744
  ```
737
745
 
738
746
  如果使用 `.local\launchers\` 下的个人启动器,也需要同步追加对应
@@ -751,7 +759,7 @@ powershell.exe -NoProfile -ExecutionPolicy Bypass -File "%CD%\scripts\start-patc
751
759
  | --- | --- | --- |
752
760
  | Tunnel 一直连接超时 | 默认 7892 没有代理服务 | 确认实际 HTTP/Mixed 端口,设置 `HTTPS_PROXY` 后从同一窗口启动。 |
753
761
  | 日志出现 403 和 `unsupported_country_region_territory` | 代理出口区域不受支持 | 切换出口区域,再重启 Tunnel。 |
754
- | `list_workspace` 只看到 `tunnel-client.exe` | MCP 从错误目录启动或没收到配置路径 | 使用 `scripts/patchwarden-mcp-stdio.cmd`。 |
762
+ | `list_workspace` 只看到 `tunnel-client.exe` | MCP 从错误目录启动或没收到配置路径 | 使用 `scripts/mcp/patchwarden-mcp-stdio.cmd`。 |
755
763
  | MCP 显示 connected,但任务不执行 | Watcher 没启动或心跳过期 | 启动 `npm.cmd run watch`,再看 `health_check`。 |
756
764
  | `Agent command not found` | Agent 不在 PATH,或 Codex Desktop 被误当成 CLI | 运行 `where.exe`,必要时在 `agents.command` 写真实 CLI 路径。 |
757
765
  | 验证命令被拒绝 | 与白名单不是逐字一致 | 把确切命令加入 `allowedTestCommands`,不要扩大成任意 Shell。 |
@@ -828,19 +836,19 @@ PatchWarden v0.4.0 不自动读取旧 CLI、旧环境变量、旧 Header、旧
828
836
 
829
837
  ## MCP 工具与 Profile
830
838
 
831
- `chatgpt_core` 是固定的 16 工具 Profile,适合 ChatGPT Tunnel:
839
+ `chatgpt_core` 是固定的 21 工具 Profile,适合 ChatGPT Tunnel:
832
840
 
833
841
  `health_check`、`list_agents`、`list_workspace`、
834
842
  `read_workspace_file`、`save_plan`、`create_task`、
835
843
  `wait_for_task`、`get_task_summary`、`get_diff`、`get_result`、
836
844
  `get_result_json`、`get_test_log`、`get_task_status`、`list_tasks`、
837
- `cancel_task`、`audit_task`。
845
+ `cancel_task`、`audit_task`、`safe_status`、`safe_result`、`safe_audit`、`safe_test_summary`、`safe_diff_summary`。
838
846
 
839
847
  `get_task_summary` 默认保留兼容的 `standard` 视图;ChatGPT 应优先使用
840
848
  `view: "compact"`,终态 `wait_for_task` 也只内嵌 compact 验收证据。
841
849
 
842
- `full` `chatgpt_core` 基础上额外提供 6 个管理工具,合计 22 个核心
843
- 工具;启用 Direct 后再追加 6 个 Direct 工具,共 28 个工具(22 + 6):
850
+ `full` 提供完整 54 工具本地开发目录,包含核心工具、管理工具和 Direct
851
+ 工具。除 `chatgpt_core` 外,常用额外管理工具包括:
844
852
 
845
853
  - `get_plan`
846
854
  - `kill_task`
@@ -849,15 +857,15 @@ PatchWarden v0.4.0 不自动读取旧 CLI、旧环境变量、旧 Header、旧
849
857
  - `get_task_stdout_tail`
850
858
  - `get_task_log_tail`
851
859
 
852
- `chatgpt_direct` 是 v0.6.0 新增的 Direct 直接开发 Profile,包含 9 个工具:
860
+ `chatgpt_direct` 是 v0.6.0 新增的 Direct 直接开发 Profile,v1.1 包含 13 个工具:
853
861
 
854
862
  `health_check`、`list_workspace`、`create_direct_session`、
855
863
  `search_workspace`、`read_workspace_file`、`apply_patch`、
856
- `run_verification`、`finalize_direct_session`、`audit_session`。
864
+ `run_verification`、`finalize_direct_session`、`audit_session`、`safe_direct_summary`、`safe_finalize_direct_session`、`safe_audit_direct_session`、`sync_file`。
857
865
 
858
866
  `chatgpt_direct` 默认关闭,需要通过 `enableDirectProfile: true` 或
859
867
  `PATCHWARDEN_TOOL_PROFILE=chatgpt_direct` 显式启用。`chatgpt_core` 保持
860
- 16 工具不变。
868
+ 21 工具清单。
861
869
 
862
870
  Tunnel 包装脚本会强制使用 `chatgpt_core`;普通本地开发默认使用 `full`。
863
871
 
@@ -912,7 +920,7 @@ Tunnel ID。启动器使用 `patchwarden-direct` Profile、独立的
912
920
  Tunnel API Key 仍通过现有 Windows DPAPI 缓存处理,不会写入仓库。
913
921
 
914
922
  连接 ChatGPT 后新建对话并先调用 `health_check`。预期
915
- `tool_profile=chatgpt_direct`、`tool_count=9`、
923
+ `tool_profile=chatgpt_direct`、`tool_count=13`、
916
924
  `direct_profile_enabled=true`。已有对话可能缓存旧工具清单,需要重新连接
917
925
  Connector 后再新建对话。
918
926
 
@@ -975,7 +983,7 @@ PatchWarden 能降低误操作风险,但不能替代人工审查。第一次
975
983
  升级 npm 固定版本:
976
984
 
977
985
  ```powershell
978
- npm.cmd install patchwarden@0.6.0
986
+ npm.cmd install patchwarden@<published-version>
979
987
  ```
980
988
 
981
989
  源码升级:
@@ -1040,6 +1048,8 @@ Release 和发布资产校验值。
1040
1048
 
1041
1049
  ## 相关文档
1042
1050
 
1051
+ - [v0.6.4 发布说明](docs/release-v0.6.4.md)
1052
+ - [v0.6.1 发布说明](docs/release-v0.6.1.md)
1043
1053
  - [v0.6.0 发布说明](docs/release-v0.6.0.md)
1044
1054
  - [ChatGPT 调用规范](docs/chatgpt-usage.md)
1045
1055
  - [旧版本迁移指南](docs/migration-from-safe-bifrost.md)
@@ -1056,8 +1066,9 @@ Release 和发布资产校验值。
1056
1066
  - [x] ChatGPT Connector / Tunnel
1057
1067
  - [x] Doctor 与运行时健康检查
1058
1068
  - [x] Tool Manifest 与 Schema 漂移检测
1059
- - [ ] Worktree 隔离
1060
- - [ ] Agent 任务队列
1069
+ - [x] Release Gate(发布前五阶段校验)
1070
+ - [x] Worktree 隔离
1071
+ - [x] 多 Agent 路由
1061
1072
  - [ ] 本地 Dashboard
1062
1073
 
1063
1074
  ## License
@@ -0,0 +1,6 @@
1
+ @echo off
2
+ setlocal
3
+ cd /d "%~dp0"
4
+ powershell -ExecutionPolicy Bypass -NoProfile -File "%~dp0scripts\control\restart-control-center.ps1" %*
5
+ set EXITCODE=%ERRORLEVEL%
6
+ endlocal & exit /b %EXITCODE%
@@ -0,0 +1,11 @@
1
+ @echo off
2
+ setlocal
3
+ cd /d "%~dp0"
4
+ powershell -ExecutionPolicy Bypass -NoProfile -File "%~dp0scripts\control\stop-patchwarden.ps1" %*
5
+ set EXITCODE=%ERRORLEVEL%
6
+ if not "%EXITCODE%"=="0" (
7
+ echo.
8
+ echo PatchWarden stop exited with code %EXITCODE%.
9
+ pause
10
+ )
11
+ endlocal & exit /b %EXITCODE%
@@ -0,0 +1,40 @@
1
+ export interface AgentRouteInput {
2
+ goal?: string;
3
+ scope?: string[];
4
+ inline_plan?: string;
5
+ template?: string;
6
+ configuredAgents: string[];
7
+ }
8
+ export interface AgentRouteResult {
9
+ recommended_agent: string;
10
+ reason: string;
11
+ fallback: boolean;
12
+ }
13
+ export declare const AGENT_ROUTING_RULES: {
14
+ /** 大规模代码修改 → opencode */
15
+ readonly largeScope: {
16
+ readonly agent: "opencode";
17
+ readonly threshold: 10;
18
+ };
19
+ /** 单文件修改 → patchwarden-direct */
20
+ readonly singleFile: {
21
+ readonly agent: "patchwarden-direct";
22
+ };
23
+ /** 验收审计 → patchwarden-audit */
24
+ readonly audit: {
25
+ readonly agent: "patchwarden-audit";
26
+ readonly keywords: readonly ["审计", "audit", "验收", "verify"];
27
+ };
28
+ /** 复杂推理和重构 → codex */
29
+ readonly refactor: {
30
+ readonly agent: "codex";
31
+ readonly keywords: readonly ["重构", "refactor", "跨模块", "redesign"];
32
+ };
33
+ /** 文档整理 → claude(fallback 到 opencode) */
34
+ readonly documentation: {
35
+ readonly agent: "claude";
36
+ readonly fallbackAgent: "opencode";
37
+ readonly keywords: readonly ["文档", "readme", "changelog", "doc"];
38
+ };
39
+ };
40
+ export declare function routeAgent(input: AgentRouteInput): AgentRouteResult;