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.
- package/PatchWarden-Control-Tray.cmd +11 -0
- package/PatchWarden-Control.cmd +6 -0
- package/PatchWarden-Desktop.cmd +5 -0
- package/PatchWarden.cmd +1 -1
- package/README.en.md +112 -24
- package/README.md +36 -25
- package/Restart-PatchWarden-Control.cmd +6 -0
- package/Stop-PatchWarden.cmd +11 -0
- package/dist/agents/agentRouter.d.ts +40 -0
- package/dist/agents/agentRouter.js +95 -0
- package/dist/config.d.ts +1 -1
- package/dist/config.js +6 -2
- package/dist/controlCenter.d.ts +14 -0
- package/dist/controlCenter.js +2015 -0
- package/dist/doctor.js +35 -4
- package/dist/goal/acceptanceEngine.d.ts +62 -0
- package/dist/goal/acceptanceEngine.js +103 -0
- package/dist/goal/acceptanceTemplate.d.ts +10 -0
- package/dist/goal/acceptanceTemplate.js +104 -0
- package/dist/goal/goalGraph.d.ts +58 -0
- package/dist/goal/goalGraph.js +189 -0
- package/dist/goal/goalProgress.d.ts +81 -0
- package/dist/goal/goalProgress.js +216 -0
- package/dist/goal/goalStatus.d.ts +60 -0
- package/dist/goal/goalStatus.js +137 -0
- package/dist/goal/goalStore.d.ts +79 -0
- package/dist/goal/goalStore.js +211 -0
- package/dist/goal/handoffExport.d.ts +34 -0
- package/dist/goal/handoffExport.js +183 -0
- package/dist/goal/subgoalSync.d.ts +40 -0
- package/dist/goal/subgoalSync.js +72 -0
- package/dist/goal/worktreeManager.d.ts +96 -0
- package/dist/goal/worktreeManager.js +292 -0
- package/dist/logging.d.ts +44 -0
- package/dist/logging.js +68 -0
- package/dist/release/releaseGate.d.ts +99 -0
- package/dist/release/releaseGate.js +475 -0
- package/dist/runner/postTaskCleanup.d.ts +13 -0
- package/dist/runner/postTaskCleanup.js +147 -0
- package/dist/runner/runTask.js +50 -10
- package/dist/security/discoveryTokenStore.d.ts +62 -0
- package/dist/security/discoveryTokenStore.js +100 -0
- package/dist/security/toolInvocationGuard.d.ts +35 -0
- package/dist/security/toolInvocationGuard.js +153 -0
- package/dist/smoke-test.js +18 -10
- package/dist/taskRuntime.d.ts +17 -0
- package/dist/test/unit/acceptance-engine.test.d.ts +1 -0
- package/dist/test/unit/acceptance-engine.test.js +228 -0
- package/dist/test/unit/agent-router.test.d.ts +1 -0
- package/dist/test/unit/agent-router.test.js +287 -0
- package/dist/test/unit/audit-checks.test.d.ts +1 -0
- package/dist/test/unit/audit-checks.test.js +350 -0
- package/dist/test/unit/diagnose-task.test.d.ts +1 -0
- package/dist/test/unit/diagnose-task.test.js +457 -0
- package/dist/test/unit/discovery-token-store.test.d.ts +1 -0
- package/dist/test/unit/discovery-token-store.test.js +139 -0
- package/dist/test/unit/goal-graph.test.d.ts +1 -0
- package/dist/test/unit/goal-graph.test.js +298 -0
- package/dist/test/unit/goal-progress.test.d.ts +1 -0
- package/dist/test/unit/goal-progress.test.js +381 -0
- package/dist/test/unit/goal-status.test.d.ts +1 -0
- package/dist/test/unit/goal-status.test.js +215 -0
- package/dist/test/unit/goal-store.test.d.ts +1 -0
- package/dist/test/unit/goal-store.test.js +253 -0
- package/dist/test/unit/goal-subgoal-task.test.d.ts +1 -0
- package/dist/test/unit/goal-subgoal-task.test.js +55 -0
- package/dist/test/unit/goal-tools-registry.test.d.ts +1 -0
- package/dist/test/unit/goal-tools-registry.test.js +190 -0
- package/dist/test/unit/handoff-export.test.d.ts +1 -0
- package/dist/test/unit/handoff-export.test.js +263 -0
- package/dist/test/unit/invoke-discovered-tool.test.d.ts +1 -0
- package/dist/test/unit/invoke-discovered-tool.test.js +167 -0
- package/dist/test/unit/logging.test.js +127 -5
- package/dist/test/unit/post-task-cleanup.test.d.ts +1 -0
- package/dist/test/unit/post-task-cleanup.test.js +48 -0
- package/dist/test/unit/reconcile-tasks.test.d.ts +1 -0
- package/dist/test/unit/reconcile-tasks.test.js +456 -0
- package/dist/test/unit/release-gate.test.d.ts +1 -0
- package/dist/test/unit/release-gate.test.js +242 -0
- package/dist/test/unit/safe-views.test.d.ts +1 -0
- package/dist/test/unit/safe-views.test.js +171 -0
- package/dist/test/unit/schema-drift-check.test.d.ts +1 -0
- package/dist/test/unit/schema-drift-check.test.js +175 -0
- package/dist/test/unit/subgoal-sync.test.d.ts +1 -0
- package/dist/test/unit/subgoal-sync.test.js +183 -0
- package/dist/test/unit/tool-invocation-guard.test.d.ts +1 -0
- package/dist/test/unit/tool-invocation-guard.test.js +432 -0
- package/dist/test/unit/tool-usage-stats.test.d.ts +1 -0
- package/dist/test/unit/tool-usage-stats.test.js +300 -0
- package/dist/test/unit/toolSearch.test.d.ts +1 -0
- package/dist/test/unit/toolSearch.test.js +571 -0
- package/dist/test/unit/worktree-manager.test.d.ts +1 -0
- package/dist/test/unit/worktree-manager.test.js +176 -0
- package/dist/tools/auditTask.d.ts +103 -1
- package/dist/tools/auditTask.js +461 -8
- package/dist/tools/cancelTask.js +1 -1
- package/dist/tools/checkReleaseGate.d.ts +21 -0
- package/dist/tools/checkReleaseGate.js +22 -0
- package/dist/tools/createTask.d.ts +18 -2
- package/dist/tools/createTask.js +29 -1
- package/dist/tools/diagnoseTask.d.ts +45 -0
- package/dist/tools/diagnoseTask.js +347 -0
- package/dist/tools/discardWorktree.d.ts +24 -0
- package/dist/tools/discardWorktree.js +27 -0
- package/dist/tools/discoverTools.d.ts +11 -0
- package/dist/tools/discoverTools.js +39 -0
- package/dist/tools/explainTool.d.ts +11 -0
- package/dist/tools/explainTool.js +21 -0
- package/dist/tools/getTaskSummary.js +2 -1
- package/dist/tools/goalSubgoalTask.d.ts +51 -0
- package/dist/tools/goalSubgoalTask.js +110 -0
- package/dist/tools/healthCheck.d.ts +1 -0
- package/dist/tools/healthCheck.js +5 -1
- package/dist/tools/invokeDiscoveredTool.d.ts +37 -0
- package/dist/tools/invokeDiscoveredTool.js +112 -0
- package/dist/tools/listTasks.d.ts +3 -1
- package/dist/tools/listTasks.js +14 -1
- package/dist/tools/mergeWorktree.d.ts +24 -0
- package/dist/tools/mergeWorktree.js +27 -0
- package/dist/tools/reconcileTasks.d.ts +41 -0
- package/dist/tools/reconcileTasks.js +352 -0
- package/dist/tools/registry.js +550 -0
- package/dist/tools/safeStatus.d.ts +31 -1
- package/dist/tools/safeStatus.js +43 -1
- package/dist/tools/safeViews.d.ts +256 -0
- package/dist/tools/safeViews.js +250 -0
- package/dist/tools/schemaDriftCheck.d.ts +46 -0
- package/dist/tools/schemaDriftCheck.js +80 -0
- package/dist/tools/toolCatalog.d.ts +4 -3
- package/dist/tools/toolCatalog.js +33 -11
- package/dist/tools/toolRegistry.d.ts +61 -0
- package/dist/tools/toolRegistry.js +724 -0
- package/dist/tools/toolSearch.d.ts +110 -0
- package/dist/tools/toolSearch.js +331 -0
- package/dist/tools/toolUsageStats.d.ts +41 -0
- package/dist/tools/toolUsageStats.js +116 -0
- package/dist/tools/waitForTask.js +1 -0
- package/dist/version.d.ts +2 -2
- package/dist/version.js +2 -2
- package/dist/watcherStatus.d.ts +29 -0
- package/dist/watcherStatus.js +92 -1
- package/docs/control-center/README.md +33 -0
- package/docs/control-center/control-center-daily-driver.md +211 -0
- package/docs/control-center/control-center-mvp.md +205 -0
- package/docs/control-center/control-center-phase2.md +159 -0
- package/docs/demo.md +3 -0
- package/docs/release-v0.6.4.md +45 -0
- package/examples/openai-tunnel/README.md +5 -5
- package/examples/openai-tunnel/tunnel-client.example.yaml +3 -3
- package/package.json +25 -16
- package/scripts/README.md +47 -0
- package/scripts/{brand-check.js → checks/brand-check.js} +2 -2
- package/scripts/checks/control-center-smoke.js +1098 -0
- package/scripts/{control-smoke.js → checks/control-smoke.js} +19 -5
- package/scripts/{doctor-smoke.js → checks/doctor-smoke.js} +2 -1
- package/scripts/{http-mcp-smoke.js → checks/http-mcp-smoke.js} +2 -2
- package/scripts/{lifecycle-smoke.js → checks/lifecycle-smoke.js} +25 -21
- package/scripts/{mcp-manifest-check.js → checks/mcp-manifest-check.js} +54 -7
- package/scripts/{mcp-smoke.js → checks/mcp-smoke.js} +40 -11
- package/scripts/{package-manifest-check.js → checks/package-manifest-check.js} +2 -1
- package/scripts/{tunnel-supervisor-smoke.js → checks/tunnel-supervisor-smoke.js} +2 -2
- package/scripts/{unit-tests.js → checks/unit-tests.js} +1 -1
- package/scripts/{watcher-supervisor-smoke.js → checks/watcher-supervisor-smoke.js} +13 -7
- package/scripts/control/control-center-tray.ps1 +281 -0
- package/scripts/{get-patchwarden-health.ps1 → control/get-patchwarden-health.ps1} +3 -3
- package/scripts/{manage-patchwarden.ps1 → control/manage-patchwarden.ps1} +30 -4
- package/scripts/control/restart-control-center.ps1 +173 -0
- package/scripts/{restart-patchwarden.ps1 → control/restart-patchwarden.ps1} +1 -1
- package/scripts/control/start-control-center.ps1 +263 -0
- package/scripts/{start-patchwarden-tunnel.ps1 → control/start-patchwarden-tunnel.ps1} +48 -6
- package/scripts/control/stop-patchwarden.ps1 +114 -0
- package/scripts/launchers/Check-PatchWarden-Health.cmd +1 -1
- package/scripts/launchers/Reset-PatchWarden-Tunnel-Key.cmd +1 -1
- package/scripts/launchers/Restart-PatchWarden.cmd +1 -1
- package/scripts/launchers/Start-PatchWarden-Direct-Tunnel.cmd +1 -1
- package/scripts/launchers/Start-PatchWarden-Tunnel.cmd +1 -1
- package/scripts/{patchwarden-mcp-direct.cmd → mcp/patchwarden-mcp-direct.cmd} +1 -1
- package/scripts/{patchwarden-mcp-stdio.cmd → mcp/patchwarden-mcp-stdio.cmd} +1 -1
- package/scripts/{pack-clean.js → release/pack-clean.js} +9 -1
- package/src/agents/agentRouter.ts +149 -0
- package/src/config.ts +9 -3
- package/src/controlCenter.ts +2166 -0
- package/src/doctor.ts +40 -5
- package/src/goal/acceptanceEngine.ts +160 -0
- package/src/goal/acceptanceTemplate.ts +121 -0
- package/src/goal/goalGraph.ts +225 -0
- package/src/goal/goalProgress.ts +301 -0
- package/src/goal/goalStatus.ts +234 -0
- package/src/goal/goalStore.ts +306 -0
- package/src/goal/handoffExport.ts +211 -0
- package/src/goal/subgoalSync.ts +82 -0
- package/src/goal/worktreeManager.ts +404 -0
- package/src/logging.ts +91 -0
- package/src/release/releaseGate.ts +567 -0
- package/src/runner/postTaskCleanup.ts +154 -0
- package/src/runner/runTask.ts +49 -10
- package/src/security/discoveryTokenStore.ts +157 -0
- package/src/security/toolInvocationGuard.ts +251 -0
- package/src/smoke-test.ts +15 -7
- package/src/taskRuntime.ts +17 -0
- package/src/test/unit/acceptance-engine.test.ts +261 -0
- package/src/test/unit/agent-router.test.ts +342 -0
- package/src/test/unit/audit-checks.test.ts +567 -0
- package/src/test/unit/diagnose-task.test.ts +544 -0
- package/src/test/unit/discovery-token-store.test.ts +181 -0
- package/src/test/unit/goal-graph.test.ts +347 -0
- package/src/test/unit/goal-progress.test.ts +538 -0
- package/src/test/unit/goal-status.test.ts +270 -0
- package/src/test/unit/goal-store.test.ts +318 -0
- package/src/test/unit/goal-subgoal-task.test.ts +72 -0
- package/src/test/unit/goal-tools-registry.test.ts +243 -0
- package/src/test/unit/handoff-export.test.ts +295 -0
- package/src/test/unit/invoke-discovered-tool.test.ts +216 -0
- package/src/test/unit/logging.test.ts +177 -5
- package/src/test/unit/post-task-cleanup.test.ts +53 -0
- package/src/test/unit/reconcile-tasks.test.ts +551 -0
- package/src/test/unit/release-gate.test.ts +314 -0
- package/src/test/unit/safe-views.test.ts +184 -0
- package/src/test/unit/schema-drift-check.test.ts +258 -0
- package/src/test/unit/subgoal-sync.test.ts +236 -0
- package/src/test/unit/tool-invocation-guard.test.ts +542 -0
- package/src/test/unit/tool-usage-stats.test.ts +384 -0
- package/src/test/unit/toolSearch.test.ts +756 -0
- package/src/test/unit/worktree-manager.test.ts +247 -0
- package/src/tools/auditTask.ts +831 -402
- package/src/tools/cancelTask.ts +1 -1
- package/src/tools/checkReleaseGate.ts +45 -0
- package/src/tools/createTask.ts +64 -6
- package/src/tools/diagnoseTask.ts +460 -0
- package/src/tools/discardWorktree.ts +42 -0
- package/src/tools/discoverTools.ts +51 -0
- package/src/tools/explainTool.ts +26 -0
- package/src/tools/getTaskSummary.ts +2 -1
- package/src/tools/goalSubgoalTask.ts +170 -0
- package/src/tools/healthCheck.ts +4 -1
- package/src/tools/invokeDiscoveredTool.ts +163 -0
- package/src/tools/listTasks.ts +16 -2
- package/src/tools/mergeWorktree.ts +42 -0
- package/src/tools/reconcileTasks.ts +464 -0
- package/src/tools/registry.ts +618 -1
- package/src/tools/safeStatus.ts +73 -2
- package/src/tools/safeViews.ts +271 -0
- package/src/tools/schemaDriftCheck.ts +120 -0
- package/src/tools/toolCatalog.ts +34 -11
- package/src/tools/toolRegistry.ts +786 -0
- package/src/tools/toolSearch.ts +464 -0
- package/src/tools/toolUsageStats.ts +151 -0
- package/src/tools/waitForTask.ts +1 -0
- package/src/version.ts +2 -2
- package/src/watcherStatus.ts +97 -1
- package/ui/colors_and_type.css +141 -0
- package/ui/pages/audit.html +743 -0
- package/ui/pages/dashboard.html +1154 -0
- package/ui/pages/direct-sessions.html +652 -0
- package/ui/pages/logs.html +502 -0
- package/ui/pages/task-detail.html +1229 -0
- package/ui/pages/tasks.html +702 -0
- package/ui/pages/workspace.html +947 -0
- package/ui/partials/project-shell.html +362 -0
- package/ui/vendor/lucide.js +12 -0
- 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
|
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
|
[](https://nodejs.org/)
|
|
9
9
|
[](LICENSE)
|
|
10
10
|
|
|
11
|
-
Current
|
|
12
|
-
[
|
|
13
|
-
[
|
|
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
|
|
17
|
-
|
|
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
|
|
20
|
-
verification evidence.
|
|
21
|
+
local agent execute it, and returns results, diffs, artifact manifests, and
|
|
22
|
+
independent verification evidence.
|
|
21
23
|
|
|
22
24
|

|
|
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
|
|
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
|
|
277
|
+
npx.cmd -y patchwarden@<published-version>
|
|
197
278
|
```
|
|
198
279
|
|
|
199
|
-
|
|
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 `
|
|
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
|
|
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
|
|
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 = "
|
|
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
|
|
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 `
|
|
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
|
|
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`,
|
|
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
|
|
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
|
-
- [
|
|
1017
|
-
- [
|
|
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
|
[](https://nodejs.org/)
|
|
9
9
|
[](LICENSE)
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
[
|
|
13
|
-
[
|
|
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
|

|
|
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
|
|
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
|
|
191
|
+
npx.cmd -y patchwarden@<published-version>
|
|
188
192
|
```
|
|
189
193
|
|
|
190
|
-
|
|
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` 或 `
|
|
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
|
|
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` 的版本、
|
|
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` 是固定的
|
|
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`
|
|
843
|
-
|
|
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
|
|
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
|
-
|
|
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=
|
|
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
|
|
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
|
-
- [
|
|
1060
|
-
- [
|
|
1069
|
+
- [x] Release Gate(发布前五阶段校验)
|
|
1070
|
+
- [x] Worktree 隔离
|
|
1071
|
+
- [x] 多 Agent 路由
|
|
1061
1072
|
- [ ] 本地 Dashboard
|
|
1062
1073
|
|
|
1063
1074
|
## License
|
|
@@ -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;
|