@boyingliu01/xp-gate 0.32.1 → 0.32.3
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/adapters/gate-3.sh +483 -28
- package/adapters/gate-4.sh +20 -0
- package/adapters/gate-7.sh +4 -0
- package/adapters/powershell.sh +33 -7
- package/bin/xp-gate.js +48 -2
- package/gate-3.sh +37 -2
- package/gate-4.sh +8 -0
- package/hooks/gate-3.sh +37 -2
- package/hooks/gate-4.sh +8 -0
- package/hooks/post-commit +82 -0
- package/hooks/pre-commit +19 -0
- package/hooks/pre-push +21 -2
- package/lib/__tests__/doctor-audit-ledger.test.js +61 -0
- package/lib/__tests__/gate-audit.test.ts +144 -0
- package/lib/__tests__/shared-utils.test.js +22 -0
- package/lib/doctor.js +59 -1
- package/lib/gate-audit.ts +215 -7
- package/lib/mattpocock-license-verdict.json +1 -1
- package/lib/shared-utils.js +4 -1
- package/mock-policy/AGENTS.md +3 -3
- package/mutation/AGENTS.md +3 -3
- package/package.json +1 -1
- package/plugins/claude-code/.claude-plugin/plugin.json +1 -1
- package/plugins/claude-code/skills/delphi-review/AGENTS.md +3 -3
- package/plugins/claude-code/skills/sprint-flow/AGENTS.md +3 -3
- package/plugins/claude-code/skills/sprint-flow/references/phase-3-build.md +21 -0
- package/plugins/claude-code/skills/test-specification-alignment/AGENTS.md +3 -3
- package/plugins/dsh/README.md +51 -2
- package/plugins/dsh/client/client.js +760 -0
- package/plugins/dsh/lib/client.js +760 -0
- package/plugins/dsh/lib/delphi-settings.d.ts +52 -0
- package/plugins/dsh/lib/delphi-settings.d.ts.map +1 -0
- package/plugins/dsh/lib/delphi-settings.js +76 -0
- package/plugins/dsh/lib/hooks.d.ts +14 -1
- package/plugins/dsh/lib/hooks.d.ts.map +1 -1
- package/plugins/dsh/lib/hooks.js +44 -5
- package/plugins/dsh/lib/index.d.ts +63 -0
- package/plugins/dsh/lib/index.d.ts.map +1 -1
- package/plugins/dsh/lib/index.js +126 -21
- package/plugins/dsh/package.json +13 -3
- package/plugins/dsh/scripts/copy-client.cjs +37 -0
- package/plugins/dsh/skills/delphi-review/AGENTS.md +3 -3
- package/plugins/dsh/skills/sprint-flow/AGENTS.md +3 -3
- package/plugins/dsh/skills/sprint-flow/references/phase-3-build.md +21 -0
- package/plugins/dsh/skills/test-specification-alignment/AGENTS.md +3 -3
- package/plugins/dsh/src/client.test.ts +231 -0
- package/plugins/dsh/src/contract.test.ts +25 -1
- package/plugins/dsh/src/delphi-settings.test.ts +101 -0
- package/plugins/dsh/src/delphi-settings.ts +111 -0
- package/plugins/dsh/src/hooks.test.ts +48 -0
- package/plugins/dsh/src/hooks.ts +45 -5
- package/plugins/dsh/src/index.test.ts +3 -2
- package/plugins/dsh/src/index.ts +147 -25
- package/plugins/opencode/package.json +1 -1
- package/plugins/opencode/skills/delphi-review/AGENTS.md +3 -3
- package/plugins/opencode/skills/sprint-flow/AGENTS.md +3 -3
- package/plugins/opencode/skills/sprint-flow/references/phase-3-build.md +21 -0
- package/plugins/opencode/skills/test-specification-alignment/AGENTS.md +3 -3
- package/plugins/qoder/plugin.json +1 -1
- package/plugins/qoder/skills/delphi-review/AGENTS.md +3 -3
- package/plugins/qoder/skills/sprint-flow/AGENTS.md +3 -3
- package/plugins/qoder/skills/sprint-flow/references/phase-3-build.md +21 -0
- package/plugins/qoder/skills/test-specification-alignment/AGENTS.md +3 -3
- package/principles/AGENTS.md +3 -3
- package/scripts/sync-package-content.js +1 -1
- package/skills/delphi-review/AGENTS.md +3 -3
- package/skills/sprint-flow/AGENTS.md +3 -3
- package/skills/sprint-flow/references/phase-3-build.md +21 -0
- package/skills/test-specification-alignment/AGENTS.md +3 -3
|
@@ -236,6 +236,27 @@ Without these events, the Harness can only infer changes from file diffs and has
|
|
|
236
236
|
|
|
237
237
|
---
|
|
238
238
|
|
|
239
|
+
## 工具调用效率自检(P2 硬性 — 2026-10-30 诊断)
|
|
240
|
+
|
|
241
|
+
> BUILD 阶段是工具调用最密集的阶段,也是"等待时间长"的主要来源。依据
|
|
242
|
+
> `docs/plans/2026-10-30-dev-speed-diagnosis.md`:工具延迟占总耗时 58%,其中 32.7% 的
|
|
243
|
+
> shell 调用是纯读取/搜索、calls/step 仅 1.03、`job_output` 阻塞 66.5 h。以下四条在 BUILD
|
|
244
|
+
> 期间是硬性自检项,不满足不得宣称 REQ 完成。
|
|
245
|
+
|
|
246
|
+
| ❌ 低效做法 | ✅ 正确做法 |
|
|
247
|
+
|------------|------------|
|
|
248
|
+
| `cat` / `Get-Content` / `sed -n` / `head` 读文件 | 用 `read` 原生工具(毫秒级,可并发) |
|
|
249
|
+
| `grep` / `rg` / `Select-String` / `findstr` 搜内容 | 用 `grep` 原生工具 |
|
|
250
|
+
| `find` / `ls` / `Get-ChildItem` 找文件 | 用 `glob` 原生工具 |
|
|
251
|
+
| 一个一个发独立调用(改完再想下一个) | 多个互不依赖的调用放进**同一步**并发发出 |
|
|
252
|
+
| 用 `job_output wait:true` / `sleep` 反复阻塞等长任务 | `run_in_background` + 完成通知,需要时短超时取一次 |
|
|
253
|
+
| 打包/发布/插件改动只靠 CI 发现契约破坏 | 先写契约测试(`plugins/dsh/src/contract.test.ts` 范式),本地先红 |
|
|
254
|
+
|
|
255
|
+
**验收目标**:纯读取 shell 占比 <5%(现 32.7%);calls/step ≥2.0(现 1.03);`job_output`
|
|
256
|
+
调用数下降 ≥50%。这三项在 `xp-gate retro` 的 activity 统计里可复查。
|
|
257
|
+
|
|
258
|
+
---
|
|
259
|
+
|
|
239
260
|
## Blind Review — Read-Only Subagent Convention (v0.18.0+, 证据型标准步骤)
|
|
240
261
|
|
|
241
262
|
**Purpose**: Code review by an isolated subagent with read-only tool access. Replaces the former `freeze/unfreeze` mechanism.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# SKILLS/TEST-SPECIFICATION-ALIGNMENT KNOWLEDGE BASE
|
|
2
2
|
|
|
3
|
-
**Generated:** 2026-10-
|
|
4
|
-
**Commit:**
|
|
3
|
+
**Generated:** 2026-10-30
|
|
4
|
+
**Commit:** e5ca7d9d
|
|
5
5
|
**Branch:** main
|
|
6
|
-
**Version:** 0.32.
|
|
6
|
+
**Version:** 0.32.3.0
|
|
7
7
|
|
|
8
8
|
## OVERVIEW
|
|
9
9
|
Test-Specification Alignment Engine — two-stage validation ensuring tests accurately reflect requirements and design specs.
|
package/plugins/dsh/README.md
CHANGED
|
@@ -124,6 +124,48 @@ Delphi 方法的价值**完全建立在「评审者是不同模型」之上**。
|
|
|
124
124
|
`{ ok: true }` 是**无条件**返回的常量,"把退出码契约换成了一个常量,而不是真正的结果信号"。
|
|
125
125
|
机制**拒绝**给出共识,而不是盖章通过 —— 这正是它该有的行为。
|
|
126
126
|
|
|
127
|
+
## 配置界面(Plugins 页)
|
|
128
|
+
|
|
129
|
+
插件声明了 `dsh.client`(`platform: web`),在 Web GUI 里注册一个**行配置页**:
|
|
130
|
+
|
|
131
|
+
**侧边栏 Plugins → `@boyingliu01/dsh-plugin-xp-gate` → 组件 `tool-xp-gate` → 配置**
|
|
132
|
+
|
|
133
|
+
该页面可以编辑 Delphi 三席(角色 / 模型)、网关、密钥引用与共识参数;模型可从
|
|
134
|
+
**宿主已配置的 provider 目录**下拉选择,也可手填。
|
|
135
|
+
|
|
136
|
+
### 来源优先级
|
|
137
|
+
|
|
138
|
+
| 优先级 | 来源 | 说明 |
|
|
139
|
+
|---|---|---|
|
|
140
|
+
| 1 | 本插件配置里的 `delphi` 段(本页写入) | 一旦保存了席位,评审就用它 |
|
|
141
|
+
| 2 | 项目根 `.delphi-config.json` | 席位为空时自动回落,老项目**无需改动** |
|
|
142
|
+
|
|
143
|
+
页面上如果 `seats` 为空,评审继续走 `.delphi-config.json`,所以**打开页面不会静默改变行为**。
|
|
144
|
+
|
|
145
|
+
### 宿主强制的不变量(不是表单装饰)
|
|
146
|
+
|
|
147
|
+
表单只是方便,**宿主是权威**。每次评审前 `seatsFromSettings` 重新校验:
|
|
148
|
+
|
|
149
|
+
- 恰好 3 席
|
|
150
|
+
- 3 个 model 去空白后两两不同
|
|
151
|
+
- 模型不得为空或未展开的 `${...}` 占位符
|
|
152
|
+
- 配了席位就必须有 `base_url`
|
|
153
|
+
- `api_key` 必须是**凭据引用**(`${VAR}` / `{env:VAR}`);写入明文 token 会被拒绝,
|
|
154
|
+
因为那会把密钥落到 profile 文件里
|
|
155
|
+
|
|
156
|
+
> 为什么不在表单里就拦死:DSH 的 settings 表单只能编辑 `.volatile()` 字段,
|
|
157
|
+
> 而 volatile 意味着**保存即热生效**。对"每次运行都花钱"的配置来说,前端校验不够,
|
|
158
|
+
> 所以校验放在宿主、在发出任何请求之前。
|
|
159
|
+
|
|
160
|
+
### 关于 `bash` 守卫
|
|
161
|
+
|
|
162
|
+
`delphiGuard` 用**只读工具白名单**判定:只有 `read` / `grep` / `glob` / `read_image` /
|
|
163
|
+
XP-Gate 自己的报告类工具算只读,**其余一律视为可写**(包括 `bash`、`pwsh` 和将来新增的工具)。
|
|
164
|
+
|
|
165
|
+
早期版本用"已知写工具黑名单"(`write` / `edit` / `str_replace_editor`),
|
|
166
|
+
`bash` 一条命令就能改文件,等于这道 HARD-GATE 可绕过。白名单的代价是可能**误拦**新加的
|
|
167
|
+
只读工具——那会表现为"拦得太狠",而不是"悄悄放行"。
|
|
168
|
+
|
|
127
169
|
## Skills
|
|
128
170
|
|
|
129
171
|
本包在 publish 时通过 `scripts/prepack.cjs` 捆绑仓库 `skills/`(当前 12 个)。
|
|
@@ -171,7 +213,7 @@ subagent model selection:
|
|
|
171
213
|
|
|
172
214
|
```bash
|
|
173
215
|
npm install --ignore-scripts # --ignore-scripts 绕过 esbuild postinstall(受限环境会 EBUSY)
|
|
174
|
-
npm run build # tsc -> lib/
|
|
216
|
+
npm run build # tsc -> lib/,并把 client/client.js 复制成 lib/client.js
|
|
175
217
|
npm run prepare-skills # 从仓库 skills/ 复制
|
|
176
218
|
npm test # vitest
|
|
177
219
|
```
|
|
@@ -182,9 +224,16 @@ npm test # vitest
|
|
|
182
224
|
npm run build:dsh-plugin # = node scripts/build-plugin.mjs --platform dsh
|
|
183
225
|
```
|
|
184
226
|
|
|
227
|
+
> `client/client.js` 是**手写**的浏览器 bundle,不走 tsc:它以 DSH 的客户端模块格式
|
|
228
|
+
> (`window.__ModuleLoader__.load`) 编写,引用了浏览器全局,不是 TypeScript 模块。
|
|
229
|
+
> `npm run build` 的第二步(`scripts/copy-client.cjs`)负责把它放进 `lib/`。
|
|
230
|
+
|
|
185
231
|
## 注意
|
|
186
232
|
|
|
187
|
-
- `lib/` 与 `skills/` 是**构建产物**(已 gitignore
|
|
233
|
+
- `lib/` 与 `skills/` 是**构建产物**(已 gitignore),不提交;`client/client.js` 是**源文件**,要提交。
|
|
188
234
|
- `scripts/prepack.cjs` 的 skill 列表为**动态发现**(读取仓库 `skills/`),不硬编码。
|
|
189
235
|
- `plugins/dsh/package.json` 的 peerDeps 仍 pin `0.1.1-rc.2`,但实测运行在 `0.2.0-rc.2` 上
|
|
190
236
|
`defineTool` / `TOOL_ABORTED` / `HarnessError` 签名未变,无需改写。
|
|
237
|
+
- **配置项只有在导出 `Config` 之后才会显示。** 0.31.4 及更早的构建没有导出
|
|
238
|
+
`Config`,所以 `dsh --profile <name> --dump-config-schema` 里该行落在
|
|
239
|
+
`unknownConfig`,Plugins 页也就没有可编辑的字段。安装 0.32.x 后这一项自愈。
|