@boyingliu01/xp-gate 0.19.3 → 0.20.1
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-4.sh +83 -18
- package/adapters/gate-8.sh +115 -29
- package/adapters/iac.sh +1 -1
- package/adapters/powershell.sh +60 -5
- package/adapters/python.sh +38 -4
- package/adapters/typescript.sh +15 -60
- package/bin/xp-gate.js +15 -16
- package/build-integrity/__tests__/import-resolver.test.ts +59 -0
- package/build-integrity/gate-10.ts +17 -2
- package/gate-10.sh +35 -2
- package/gate-4.sh +110 -21
- package/gate-8.sh +115 -29
- package/hooks/gate-10.sh +35 -2
- package/hooks/gate-4.sh +110 -21
- package/hooks/gate-8.sh +115 -29
- package/hooks/lib/jscpd-run.sh +63 -0
- package/hooks/lib/sprint-gate-report.sh +58 -0
- package/hooks/lib/test-failure.sh +152 -0
- package/hooks/lib/typecheck.sh +141 -0
- package/hooks/lib/validate-code-walkthrough.cjs +43 -5
- package/hooks/post-merge +100 -0
- package/hooks/pre-commit +514 -184
- package/hooks/pre-push +75 -19
- package/lib/__tests__/bootstrap.test.js +23 -41
- package/lib/__tests__/check-version.test.js +8 -1
- package/lib/__tests__/detect-deps.test.js +16 -0
- package/lib/__tests__/doctor-drift-round2.test.js +212 -0
- package/lib/__tests__/doctor-executed-surface.test.js +209 -0
- package/lib/__tests__/doctor-hook-drift.test.js +329 -0
- package/lib/__tests__/doctor-machine-mutation.test.js +116 -0
- package/lib/__tests__/doctor-module-drift.test.js +206 -0
- package/lib/__tests__/doctor-module-resolution-parity.test.js +314 -0
- package/lib/__tests__/doctor-path-equivalence.test.js +59 -0
- package/lib/__tests__/doctor-repair-boundary.test.js +52 -0
- package/lib/__tests__/doctor-tui-skill-freshness.test.js +105 -0
- package/lib/__tests__/doctor.test.js +155 -0
- package/lib/__tests__/gate-runner.test.js +19 -3
- package/lib/__tests__/helpers/lib-sandbox.cjs +55 -0
- package/lib/__tests__/init.test.js +44 -17
- package/lib/__tests__/install-skill-full-dir.test.js +151 -0
- package/lib/__tests__/install-skill.test.js +51 -132
- package/lib/__tests__/language-tools-detect.test.js +158 -0
- package/lib/__tests__/phase-transition.test.js +15 -1
- package/lib/__tests__/qoder-delphi-agents.test.js +285 -0
- package/lib/__tests__/shared-paths.test.js +20 -0
- package/lib/__tests__/shared-utils.test.js +69 -0
- package/lib/__tests__/skill-flags.test.js +48 -0
- package/lib/__tests__/ui-detector.test.ts +6 -2
- package/lib/__tests__/uninstall.test.js +20 -0
- package/lib/__tests__/update-hooks.test.js +12 -0
- package/lib/__tests__/update-skill.test.js +7 -4
- package/lib/detect-deps.js +3 -20
- package/lib/doctor-tui.js +22 -5
- package/lib/doctor.js +1178 -31
- package/lib/init.js +184 -33
- package/lib/install-cmd.js +7 -4
- package/lib/install-skill.js +38 -95
- package/lib/language-tools.js +83 -4
- package/lib/mattpocock-license-verdict.json +1 -1
- package/lib/shared-paths.js +5 -2
- package/lib/shared-utils.js +47 -3
- package/lib/uninstall.js +12 -0
- package/lib/update-hooks.js +4 -4
- package/lib/update-skill.js +6 -7
- package/mock-policy/AGENTS.md +4 -4
- package/mutation/AGENTS.md +4 -4
- package/mutation/__tests__/gate-m.test.ts +66 -14
- package/mutation/__tests__/mutmut-runner.test.ts +91 -42
- package/mutation/__tests__/test-filter-parity.test.ts +37 -0
- package/mutation/gate-m.ts +21 -8
- package/package.json +2 -2
- package/plugins/claude-code/.claude-plugin/plugin.json +1 -1
- package/plugins/claude-code/skills/clipboard-vision/__tests__/clipboard-vision-distribution.test.cjs +0 -1
- package/plugins/claude-code/skills/delphi-review/AGENTS.md +4 -4
- package/plugins/claude-code/skills/delphi-review/SKILL.md +98 -14
- package/plugins/claude-code/skills/delphi-review/references/code-walkthrough.md +36 -3
- package/plugins/claude-code/skills/delphi-review/references/requirements.md +6 -6
- package/plugins/claude-code/skills/sprint-flow/AGENTS.md +4 -4
- package/plugins/claude-code/skills/sprint-flow/references/phase-2-design.md +3 -3
- package/plugins/claude-code/skills/test-specification-alignment/AGENTS.md +4 -4
- package/plugins/dsh/README.md +169 -4
- package/plugins/dsh/dsh-overlay.patch.yml +67 -0
- package/plugins/dsh/package.json +1 -1
- package/plugins/dsh/scripts/prepack.cjs +24 -19
- package/plugins/dsh/setup-dsh.ps1 +160 -0
- package/plugins/dsh/skills/clipboard-vision/__tests__/clipboard-vision-distribution.test.cjs +0 -1
- package/plugins/dsh/skills/delphi-review/AGENTS.md +4 -4
- package/plugins/dsh/skills/delphi-review/SKILL.md +98 -14
- package/plugins/dsh/skills/delphi-review/references/code-walkthrough.md +36 -3
- package/plugins/dsh/skills/delphi-review/references/requirements.md +6 -6
- package/plugins/dsh/skills/sprint-flow/AGENTS.md +4 -4
- package/plugins/dsh/skills/sprint-flow/references/phase-2-design.md +3 -3
- package/plugins/dsh/skills/test-specification-alignment/AGENTS.md +4 -4
- package/plugins/dsh/src/command.test.ts +66 -2
- package/plugins/dsh/src/command.ts +36 -14
- package/plugins/dsh/src/contract.test.ts +31 -1
- package/plugins/dsh/src/delphi-config.test.ts +190 -0
- package/plugins/dsh/src/delphi-config.ts +223 -0
- package/plugins/dsh/src/delphi-run.test.ts +181 -0
- package/plugins/dsh/src/delphi-run.ts +129 -0
- package/plugins/dsh/src/delphi.test.ts +222 -0
- package/plugins/dsh/src/delphi.ts +247 -0
- package/plugins/dsh/src/dialect.test.ts +59 -0
- package/plugins/dsh/src/dialect.ts +40 -0
- package/plugins/dsh/src/index.ts +70 -4
- package/plugins/dsh/src/skills.test.ts +26 -19
- package/plugins/opencode/package.json +1 -1
- package/plugins/opencode/skills/clipboard-vision/__tests__/clipboard-vision-distribution.test.cjs +0 -1
- package/plugins/opencode/skills/delphi-review/AGENTS.md +4 -4
- package/plugins/opencode/skills/delphi-review/SKILL.md +98 -14
- package/plugins/opencode/skills/delphi-review/references/code-walkthrough.md +36 -3
- package/plugins/opencode/skills/delphi-review/references/requirements.md +6 -6
- package/plugins/opencode/skills/sprint-flow/AGENTS.md +4 -4
- package/plugins/opencode/skills/sprint-flow/references/phase-2-design.md +3 -3
- package/plugins/opencode/skills/test-specification-alignment/AGENTS.md +4 -4
- package/plugins/qoder/agents/delphi-architecture.md +1 -1
- package/plugins/qoder/agents/delphi-feasibility.md +1 -1
- package/plugins/qoder/agents/delphi-technical.md +1 -1
- package/plugins/qoder/plugin.json +1 -1
- package/plugins/qoder/skills/clipboard-vision/__tests__/clipboard-vision-distribution.test.cjs +0 -1
- package/plugins/qoder/skills/delphi-review/AGENTS.md +4 -4
- package/plugins/qoder/skills/delphi-review/SKILL.md +98 -14
- package/plugins/qoder/skills/delphi-review/references/code-walkthrough.md +36 -3
- package/plugins/qoder/skills/delphi-review/references/requirements.md +6 -6
- package/plugins/qoder/skills/sprint-flow/AGENTS.md +4 -4
- package/plugins/qoder/skills/sprint-flow/references/phase-2-design.md +3 -3
- package/plugins/qoder/skills/test-specification-alignment/AGENTS.md +4 -4
- package/principles/AGENTS.md +9 -8
- package/principles/__tests__/adapter-metrics.test.ts +292 -0
- package/principles/__tests__/analyzer.test.ts +29 -6
- package/principles/__tests__/baseline-prune-timeout.test.ts +71 -0
- package/principles/__tests__/baseline-prune.test.ts +338 -0
- package/principles/__tests__/boy-scout-init-baseline.test.ts +167 -0
- package/principles/__tests__/boy-scout-integration.test.ts +97 -6
- package/principles/__tests__/boy-scout.test.ts +253 -7
- package/principles/__tests__/config-enforcement.test.ts +469 -0
- package/principles/__tests__/config-git-timeout.test.ts +66 -0
- package/principles/__tests__/direct-execution.test.ts +187 -0
- package/principles/__tests__/index.test.ts +16 -3
- package/principles/__tests__/warnings-baseline-budgets.test.ts +74 -0
- package/principles/adapters/typescript.ts +613 -13
- package/principles/analyzer.ts +22 -0
- package/principles/baseline-prune.ts +217 -0
- package/principles/boy-scout.ts +516 -56
- package/principles/config.ts +362 -54
- package/principles/direct-execution.ts +60 -0
- package/principles/index.ts +40 -17
- package/principles/rules/__tests__/clean-code/many-exports.test.ts +16 -10
- package/principles/rules/clean-code/code-duplication.ts +8 -8
- package/principles/rules/clean-code/deep-nesting.ts +8 -8
- package/principles/rules/clean-code/god-class.ts +8 -8
- package/principles/rules/clean-code/large-file.ts +15 -11
- package/principles/rules/clean-code/long-function.ts +8 -8
- package/principles/rules/clean-code/magic-numbers.ts +10 -7
- package/principles/rules/clean-code/many-exports.ts +7 -7
- package/principles/rules/clean-code/missing-error-handling.ts +5 -5
- package/principles/rules/clean-code/too-many-params.ts +8 -8
- package/principles/rules/clean-code/unused-imports.ts +5 -5
- package/principles/rules/solid/dip.ts +18 -8
- package/principles/rules/solid/isp.ts +9 -8
- package/principles/rules/solid/lsp.ts +6 -6
- package/principles/rules/solid/ocp.ts +6 -5
- package/principles/rules/solid/srp.ts +7 -8
- package/principles/types.ts +15 -0
- package/scripts/__tests__/sync-package-content.test.js +28 -0
- package/scripts/delphi-external-review.cjs +193 -10
- package/scripts/sync-package-content.js +20 -10
- package/skills/clipboard-vision/__tests__/clipboard-vision-distribution.test.cjs +0 -1
- package/skills/delphi-review/AGENTS.md +4 -4
- package/skills/delphi-review/SKILL.md +98 -14
- package/skills/delphi-review/references/code-walkthrough.md +36 -3
- package/skills/delphi-review/references/requirements.md +6 -6
- package/skills/sprint-flow/AGENTS.md +4 -4
- package/skills/sprint-flow/references/phase-2-design.md +3 -3
- package/skills/test-specification-alignment/AGENTS.md +4 -4
- package/lib/__tests__/download-skill.test.js +0 -281
- package/lib/download-skill.js +0 -96
package/plugins/claude-code/skills/clipboard-vision/__tests__/clipboard-vision-distribution.test.cjs
CHANGED
|
@@ -19,7 +19,6 @@ describe('clipboard-vision distribution', () => {
|
|
|
19
19
|
'scripts/build-plugin.mjs',
|
|
20
20
|
'scripts/build-plugin.sh',
|
|
21
21
|
'scripts/test-plugins.mjs',
|
|
22
|
-
'scripts/test-plugins.sh',
|
|
23
22
|
'src/npm-package/scripts/sync-package-content.js',
|
|
24
23
|
'plugins/opencode/scripts/prepack.cjs',
|
|
25
24
|
'src/npm-package/plugins/opencode/scripts/prepack.cjs',
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# SKILLS/DELPHI-REVIEW KNOWLEDGE BASE
|
|
2
2
|
|
|
3
|
-
**Generated:** 2026-
|
|
4
|
-
**Commit:**
|
|
5
|
-
**Branch:**
|
|
6
|
-
**Version:** 0.
|
|
3
|
+
**Generated:** 2026-10-08
|
|
4
|
+
**Commit:** unknown
|
|
5
|
+
**Branch:** unknown
|
|
6
|
+
**Version:** 0.20.1.0
|
|
7
7
|
|
|
8
8
|
## OVERVIEW
|
|
9
9
|
Delphi Consensus Review — multi-round anonymous expert review (≥90% threshold, exactly 3 experts with distinct executable model IDs). Supports design, requirements, and code-walkthrough modes.
|
|
@@ -249,7 +249,7 @@ tools_denied:
|
|
|
249
249
|
|
|
250
250
|
1. **Step 0: Input Validation** — Check input contains reviewable content (design doc/code/spec/diff). Empty input → `[DelphiReview:BLOCKED]`.
|
|
251
251
|
2. **Round 1: Anonymous Independent Review** — Invoke architecture, technical, and feasibility independently without exposing their opinions to one another. Every successful result must use `result_type=delphi_expert_result`.
|
|
252
|
-
3. **Execution Verification** — Verify that all three results succeeded and that their `requested_model` values are three distinct trimmed IDs. A local fallback (`provider: local`) is not an executed expert and cannot satisfy this check; a local hosted endpoint configured as an ordinary callable provider can.
|
|
252
|
+
3. **Execution Verification** — Verify that all three results succeeded and that their `requested_model` values are three distinct trimmed IDs, confirmed against the platform's execution record rather than expert self-report alone (OpenCode: the provider call log; Qoder: the `model` field of `model.request.started` events under `~/.qoder/logs/sessions/<project>/<sessionId>/segments/*.jsonl` — the `--model` argv in `~/.qoder/logs/runs/*/manifest.json` is the session model and proves nothing about subagents). A local fallback (`provider: local`) is not an executed expert and cannot satisfy this check; a local hosted endpoint configured as an ordinary callable provider can. Each expert record must also carry an explicit `channel` of either `external` or `local`; the value is a whitelist and a missing or unknown value fails the gate (it is never defaulted, since defaulting would let a forged record pass by simply omitting the field). Where the platform pins subagents to the session model (current Qoder Custom Agent dispatch, see the Qoder section below), the check cannot pass on built-in models at all and the external provider path is required.
|
|
253
253
|
4. **Consensus Check** — Aggregate all three successful expert results. Consensus >=90% AND all APPROVED → complete. One expert result is never global approval.
|
|
254
254
|
5. **Rounds 2-5: Exchange and Final Positions** — If needed, expose prior aggregate evidence, re-evaluate, and stop at the first approved consensus or after five rounds.
|
|
255
255
|
6. **Failure Handling** — Any expert failure, missing result, duplicate model ID, or unverifiable execution blocks the review. Do not substitute a local fallback or silently reduce the expert count.
|
|
@@ -327,27 +327,111 @@ Each round MUST output a structured round marker:
|
|
|
327
327
|
- ✅ 三个角色可以共享一个 provider 和 token 计划
|
|
328
328
|
- ❌ `provider: local` 的特殊 fallback 不能计为一次成功执行
|
|
329
329
|
|
|
330
|
-
#### Qoder
|
|
330
|
+
#### Qoder 平台(Custom Agent 模式 — 只能做到同模型三角色)
|
|
331
331
|
|
|
332
|
-
Qoder
|
|
332
|
+
Qoder 的内置模型**没有本地推理端点**:推理请求由 Qoder 客户端经服务端代理发出,凭证是一次性 job token。所以不能照搬 OpenCode 的 `base_url + api_key` 直连方式;Qoder 侧内置模型的唯一入口是 **Custom Agent** —— 每个专家一个独立 agent 文件,frontmatter 用 `model` 字段声明模型。
|
|
333
333
|
|
|
334
|
-
|
|
335
|
-
|------|-----------|------|-------------|
|
|
336
|
-
| Architecture (A) | `.qoder/agents/delphi-architecture.md` | Qwen3.7-Max | 0.5× |
|
|
337
|
-
| Technical (B) | `.qoder/agents/delphi-technical.md` | GLM-5.2 | 0.6× |
|
|
338
|
-
| Feasibility (C) | `.qoder/agents/delphi-feasibility.md` | DeepSeek-V4-Pro | 0.5× |
|
|
334
|
+
**契约结论(先说结论)**:这条路径**不满足**"三个不同可执行模型 ID"契约。2026-09-23 做过一次排除混杂因素的复测:先把 `~/.qoder/agents/delphi-*.md` 三份文件绑成三个不同的 0.1× 内置模型(`qfmodel` / `dfmodel` / `gfmodel`;架构角与会话模型同名,所以真正有判别力的是技术角与可行性角),**再**新开会话——新 CLI 进程,`session.config.loaded` 记录 `model: "qfmodel"`,注册表加载的必然是已修好的绑定——然后只派发三个 subagent,各回一句话、不调工具。结果:三个独立的 `is_subagent: true` turn,`turn.started` / `model.request.started` / `model.response.completed` 三处的 `model` 全为会话模型 `qfmodel`,`dfmodel` / `gfmodel` 出现 0 次;同时三份回复分别命中架构 / 技术 / 可行性视角,说明角色提示词确实生效、agent 也确实被加载。即 `subagent_type` 派发路径采纳 Custom Agent 的提示词,但**丢弃**它的 `model` 绑定。
|
|
339
335
|
|
|
340
|
-
|
|
336
|
+
因此 Qoder 原生模式只能作为**同模型、三角色(persona)的自查**,其共识比例不能当作多模型交叉验证的证据,也不应用作 Gate MW 的三模型凭据。需要契约合规的 Delphi 时,按上面的外部 provider 方式配置 `.delphi-config.json`(Qoder 与 OpenCode 同用,条件是模型确有可调端点)。
|
|
341
337
|
|
|
342
|
-
|
|
338
|
+
| 角色 | Agent 文件 | 绑定的 modelId | 实际执行模型 |
|
|
339
|
+
|------|-----------|---------------|-------------|
|
|
340
|
+
| Architecture (A) | `.qoder/agents/delphi-architecture.md` | `qfmodel` | 会话模型 |
|
|
341
|
+
| Technical (B) | `.qoder/agents/delphi-technical.md` | `gfmodel` | 会话模型 |
|
|
342
|
+
| Feasibility (C) | `.qoder/agents/delphi-feasibility.md` | `dfmodel` | 会话模型 |
|
|
343
|
+
|
|
344
|
+
**安装位置**(`xp-gate init` 自动部署,已存在的文件不覆盖):
|
|
345
|
+
- 项目级:`<project>/.qoder/agents/`(`xp-gate init`)
|
|
346
|
+
- 用户级:`~/.qoder/agents/`(`xp-gate init --global`)
|
|
347
|
+
|
|
348
|
+
**model 字段格式**:仍须写成 `"[DisplayName](modelId)"`。裸名字或已下线 ID 不会报错,会被平台静默忽略。`xp-gate init` 会审计已部署的 `delphi-*.md`,格式非法或 modelId 与本版本模板不一致时点名文件并给出"删除 → 重跑 `init` → 重启会话"提示;因为部署语义是"已存在不覆盖",从 #417 之前的版本升级必须手工删旧文件再重跑 `init`。注意:修好绑定也只是让角色声明规范,并不改变上表的执行模型结论。
|
|
349
|
+
|
|
350
|
+
**执行方式**:用 Agent tool 并行派发 3 个 subagent,`subagent_type` 分别取 `delphi-architecture`、`delphi-technical`、`delphi-feasibility`。**新建或修改 agent 文件后必须重开会话**——注册表只在会话启动时加载,否则报 `Unknown agent type`。
|
|
351
|
+
|
|
352
|
+
**客观验证(不要采信专家自述)**:`~/.qoder/logs/runs/*/manifest.json` 的 argv `--model` 记录的是**会话/进程启动模型**,对 subagent 没有判别力(历史上所有运行都是同一个 ID)。真正的证据在按会话分段的日志里:
|
|
353
|
+
|
|
354
|
+
```bash
|
|
355
|
+
grep '"type":"model.request.started"' ~/.qoder/logs/sessions/<project>/<sessionId>/segments/*.jsonl \
|
|
356
|
+
| grep -oE '"model":"[^"]*"' | sort | uniq -c
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
同一文件里的 `turn.started`(`is_subagent:true`)与 `model.response.completed` 可交叉核对:前者证明三个角色各自起了独立 turn,后者带 `provider` 字段。两个坑:(1) 被验证的那个 modelId 必须**不等于会话模型**,否则该角色测不出判别力(会话模型通常是 `qfmodel`);(2) 改完 agent 文件必须**换新会话**再测,注册表只在会话启动时加载,用旧会话的数据下结论会被旧绑定污染。专家自述的 `requested_model` 只是在复述自己 frontmatter 里的声明,不构成证据。
|
|
360
|
+
|
|
361
|
+
**成本**:走这条路径不消耗外部 API key,只计 Qoder Credits。
|
|
343
362
|
|
|
344
363
|
#### OpenCode 平台(External API 模式)
|
|
345
364
|
|
|
346
365
|
OpenCode 环境下通过 `opencode.json` 的 agent 配置 + `.delphi-config.json` 调用外部 API:
|
|
347
366
|
- **MUST 从 `opencode.json` 的 agent 配置中读取模型**
|
|
348
|
-
- 通过 `scripts/delphi-external-review.cjs` 调用各 provider 的兼容 API
|
|
367
|
+
- 通过 `scripts/delphi-external-review.cjs` 调用各 provider 的兼容 API(注意:该脚本目前在仓库根 `scripts/` 下,尚未随 skill 目录分发)
|
|
349
368
|
- 需要用户自行配置 API key(环境变量注入)
|
|
350
369
|
|
|
370
|
+
#### DeepSeek Harness 平台(`delphi-review` 工具 — 推荐)
|
|
371
|
+
|
|
372
|
+
DSH 里**不要**用 `subagent` 工具派发三个专家。原因和 Qoder 同源:DSH 的 subagent
|
|
373
|
+
继承宿主配置的**单一**模型(`SubagentModelSelectionConfig.enabled` 默认 `false`),
|
|
374
|
+
三个"专家"会是同一模型的三个实例 —— 按本 skill 的规则必须 BLOCK。
|
|
375
|
+
|
|
376
|
+
DSH 的正确入口是插件提供的 **`delphi-review` 工具**(`@boyingliu01/dsh-plugin-xp-gate`):
|
|
377
|
+
|
|
378
|
+
```
|
|
379
|
+
delphi-review(
|
|
380
|
+
subject: <待评审材料:diff / 设计 / 规格>,
|
|
381
|
+
addressed: <可选:上一轮之后改了什么,用于后续轮次>,
|
|
382
|
+
maxRounds: <可选:覆盖默认 5 轮>
|
|
383
|
+
)
|
|
384
|
+
```
|
|
385
|
+
|
|
386
|
+
该工具**直连外部 OpenAI 兼容网关**,每个席位绑定一个不同模型,因此不依赖宿主配置即可
|
|
387
|
+
满足不变量。它复用**同一份** `.delphi-config.json`,无需额外配置。
|
|
388
|
+
|
|
389
|
+
**代码强制的不变量**(不是文档约定,违反即报错):
|
|
390
|
+
|
|
391
|
+
| 不变量 | 违反时 |
|
|
392
|
+
|---|---|
|
|
393
|
+
| 恰好 3 位专家 | `DelphiConfigError` |
|
|
394
|
+
| 3 个 `requested_model` 去空白后两两不同 | `DelphiConfigError` |
|
|
395
|
+
| 模型不得为未展开的 `${...}` 占位符 | `DelphiConfigError`(在**任何网络调用之前**) |
|
|
396
|
+
| 缺密钥 / 缺 provider / 专家跨网关 | `DelphiSetupError`,报变量名而非回显配置 |
|
|
397
|
+
| 报告缺 `### VERDICT` 段 | 记为 `INVALID_NO_VERDICT`,**不计入共识** |
|
|
398
|
+
| 退出码 0 但内容为空 | 记为 ERROR(推理模型可能把预算全烧在隐藏 token 上) |
|
|
399
|
+
|
|
400
|
+
**轮次语义与本 skill 一致**:Round 1 匿名且并发;Round 2+ 回传**汇总票型**与"已修改项",
|
|
401
|
+
个体报告始终匿名。达到阈值即停,否则到 `max_review_rounds` 为止并如实返回 `NO CONSENSUS`。
|
|
402
|
+
|
|
403
|
+
**推理模型注意**:`g-glm-5.3-flash` 这类模型会先产出隐藏推理 token。
|
|
404
|
+
实测 `max_tokens=4000` 时 `finish_reason=length` 且 **content 为空**;
|
|
405
|
+
席位需独立预算(该席位配置为 32000)。工具把"空内容"记为 ERROR 而非空评审。
|
|
406
|
+
|
|
407
|
+
> 备选:若希望 DSH **原生** `subagent` 也能选模型,需同时满足
|
|
408
|
+
> (1) `dsh-tool-subagent` 的 `modelSelectionSettings: true`(仅能力开关),
|
|
409
|
+
> (2) 宿主设置 `SubagentModelSelectionConfig.enabled = true` 且 `allowedModels` ≥3 个不同模型。
|
|
410
|
+
> 该路线依赖宿主配置,CI / 一次性会话不可靠,故不作为默认路径。
|
|
411
|
+
#### WorkBuddy 平台(Expert 团队模式)
|
|
412
|
+
|
|
413
|
+
WorkBuddy 侧以 Team 型专家团(示例:`delphi-review-team`,安装在 `~/.workbuddy/plugins/marketplaces/my-experts/plugins/`,创建方式见 [docs/platform-workbuddy.md](../../docs/platform-workbuddy.md))承载评审,触发本技能后按此路由执行:
|
|
414
|
+
|
|
415
|
+
| 角色 | Agent ID | 绑定模型 | 倍率 |
|
|
416
|
+
|------|----------|---------|------|
|
|
417
|
+
| 主理人(衡定一,会话自身) | delphi-review-team-team-lead | 会话模型,固定用 `local-deepseek-v4-flash` | 零 credits |
|
|
418
|
+
| Architecture (A) | delphi-arch-reviewer | `deepseek-v4.1-flash` | x0.11 |
|
|
419
|
+
| Technical (B) | delphi-tech-reviewer | `glm-5.3-flash` | x0.06 |
|
|
420
|
+
| Feasibility (C) | delphi-feasibility-reviewer | `hy3` | x0.00(免费) |
|
|
421
|
+
|
|
422
|
+
**执行方式**:
|
|
423
|
+
- 主理人开场自检:会话模型不是 `local-deepseek-v4-flash` 时,先提醒用户切换再开始。
|
|
424
|
+
- 已启用专家团 → 按其团队机制 spawn 3 位成员;未启用 → 用 `Agent` 工具同一消息**并行** spawn 3 个 `general-purpose` 子代理,prompt = 对应专家 MD 全文人设(读专家团 `agents/` 目录)+ 匿名评审模板 + 待评审材料,`model` 参数按上表传。
|
|
425
|
+
- Round 1 三个子代理互不见对方输出(匿名铁律不变)。
|
|
426
|
+
|
|
427
|
+
**执行验证(适配本平台,2026-09-29 校准)**:
|
|
428
|
+
- 参数层路由 ✅ 已实测:`Agent` 工具 `model` 参数传 `deepseek-v4.1-flash` / `glm-5.3-flash` / `hy3` 三个 ID 均被接受,3 个 general-purpose 子代理并行执行成功。
|
|
429
|
+
- 执行层证据 ⚠️ 平台暂缺:WorkBuddy 审计日志(`~/.workbuddy/audit-log/`)只记 command-safety 事件,无 per-request 模型路由记录,无法像 Qoder/OpenCode 那样从日志取证 distinct models。
|
|
430
|
+
- **WorkBuddy 过渡验证标准**:参数级校准(model ID 被平台接受且子代理成功执行)+ 专家 `requested_model` 自述如实记录;报告中必须注明「执行层验证待平台日志支持」。若 `model` 参数被拒绝(报错/回落会话模型),按本技能 Failure Handling 处理,不得静默降级冒充三模型共识。
|
|
431
|
+
- 契约合规兜底:需要严格证据时,走外部 provider 路径(`.delphi-config.json` + 兼容 API,如 whalecloud 网关 3 个模型 ID)。
|
|
432
|
+
|
|
433
|
+
**成本**:3 专家合计 x0.17/轮;主理人选 local 会话模型则零 credits。
|
|
434
|
+
|
|
351
435
|
### 共识阈值
|
|
352
436
|
|
|
353
437
|
| 阈值 | 说明 |
|
|
@@ -454,9 +538,9 @@ Every Delphi mode MUST use the full JSON schema below. Architecture, technical,
|
|
|
454
538
|
"context_file_used": "CONTEXT.md",
|
|
455
539
|
"round": 1,
|
|
456
540
|
"expert_verdicts": [
|
|
457
|
-
{ "role": "architecture", "verdict": "APPROVED", "confidence": 9, "result_type": "delphi_expert_result", "requested_model": "provider/model-a" },
|
|
458
|
-
{ "role": "technical", "verdict": "APPROVED", "confidence": 8, "result_type": "delphi_expert_result", "requested_model": "provider/model-b" },
|
|
459
|
-
{ "role": "feasibility", "verdict": "APPROVED", "confidence": 8, "result_type": "delphi_expert_result", "requested_model": "provider/model-c" }
|
|
541
|
+
{ "role": "architecture", "verdict": "APPROVED", "confidence": 9, "result_type": "delphi_expert_result", "requested_model": "provider/model-a", "resolved_model": "provider/model-a", "channel": "external" },
|
|
542
|
+
{ "role": "technical", "verdict": "APPROVED", "confidence": 8, "result_type": "delphi_expert_result", "requested_model": "provider/model-b", "resolved_model": "provider/model-b", "channel": "external" },
|
|
543
|
+
{ "role": "feasibility", "verdict": "APPROVED", "confidence": 8, "result_type": "delphi_expert_result", "requested_model": "provider/model-c", "resolved_model": "provider/model-c", "channel": "external" }
|
|
460
544
|
],
|
|
461
545
|
"requirements_statement": "<short summary of what was reviewed>",
|
|
462
546
|
"gaps_found": [],
|
|
@@ -255,9 +255,15 @@ pre-push hook
|
|
|
255
255
|
|------|------|------|
|
|
256
256
|
| 单次走查成本 | ~$0.03 | 正常执行 |
|
|
257
257
|
| 变更规模 | 无硬性文件数或行数上限 | 大型变更必须完整评审或由用户选择拆分 |
|
|
258
|
+
| 单席位 prompt 体积 | 默认 40000 字节(`max_prompt_bytes` 可按席位覆盖) | runner 发送前拒绝,报错里给出处置办法 |
|
|
258
259
|
|
|
259
260
|
大型变更没有自动跳过或绕过路径。用户可以选择完整评审,或在评审前主动拆分变更;每个变更仍须通过完整的走查和证据验证。
|
|
260
261
|
|
|
262
|
+
**prompt 预算是硬约束,不是建议**:实测 `g-glm-5.3-flash` 在 ~40KB 正常应答(225s)、~50KB 直接崩溃
|
|
263
|
+
(305s,`0xC0000409` + libuv `UV_HANDLE_CLOSING`,表现为 "Network error.")——一个席位崩溃就会让整个共识无法完成。
|
|
264
|
+
构造输入时按重要性排序、给每个席位独立预算、并在报告里显式列出因体积省略的文件;
|
|
265
|
+
截断到「核心 hunk 看不见」比超限更糟:席位会花整轮报告「无法审计」,而这是评审者的真实缺陷而非代码缺陷。
|
|
266
|
+
|
|
261
267
|
---
|
|
262
268
|
|
|
263
269
|
## Agent 可用性检查 (MANDATORY)
|
|
@@ -356,9 +362,9 @@ IF 任何检查失败:
|
|
|
356
362
|
"verdict": "APPROVED",
|
|
357
363
|
"confidence": 9,
|
|
358
364
|
"experts": [
|
|
359
|
-
{ "id": "Expert A", "role": "architecture", "verdict": "APPROVED", "confidence": 9, "result_type": "delphi_expert_result", "requested_model": "provider/model-a", "resolved_model": "provider/model-a" },
|
|
360
|
-
{ "id": "Expert B", "role": "technical", "verdict": "APPROVED", "confidence": 8, "result_type": "delphi_expert_result", "requested_model": "provider/model-b", "resolved_model":
|
|
361
|
-
{ "id": "Expert C", "role": "feasibility", "verdict": "APPROVED", "confidence": 8, "result_type": "delphi_expert_result", "requested_model": "provider/model-c", "resolved_model": "provider/model-c" }
|
|
365
|
+
{ "id": "Expert A", "role": "architecture", "verdict": "APPROVED", "confidence": 9, "result_type": "delphi_expert_result", "requested_model": "provider/model-a", "resolved_model": "provider/model-a", "channel": "external" },
|
|
366
|
+
{ "id": "Expert B", "role": "technical", "verdict": "APPROVED", "confidence": 8, "result_type": "delphi_expert_result", "requested_model": "provider/model-b", "resolved_model": "provider/model-b", "channel": "external" },
|
|
367
|
+
{ "id": "Expert C", "role": "feasibility", "verdict": "APPROVED", "confidence": 8, "result_type": "delphi_expert_result", "requested_model": "provider/model-c", "resolved_model": "provider/model-c", "channel": "external" }
|
|
362
368
|
],
|
|
363
369
|
"issues": [],
|
|
364
370
|
"consensus_ratio": 1.0,
|
|
@@ -399,6 +405,33 @@ Hook 验证以下条件(全部满足才允许 push):
|
|
|
399
405
|
5. timestamp 未过期
|
|
400
406
|
6. expires 必须是 timestamp 之后恰好 1 小时
|
|
401
407
|
|
|
408
|
+
### experts[] 必填字段与 #423 的迁移说明
|
|
409
|
+
|
|
410
|
+
`validate-code-walkthrough.cjs` 对每个 expert 对象强制要求:
|
|
411
|
+
|
|
412
|
+
| 字段 | 约束 |
|
|
413
|
+
|------|------|
|
|
414
|
+
| `result_type` | 必须等于 `"delphi_expert_result"` |
|
|
415
|
+
| `role` | 非空,三个席位 role 互异 |
|
|
416
|
+
| `requested_model` | 非空;比较前只做 trim,**区分大小写**(规范原文是 "distinct trimmed requested model IDs",见 AGENTS.md) |
|
|
417
|
+
| `resolved_model` | 非空;比较前 trim + 转小写,三者互异 |
|
|
418
|
+
| `channel` | 必须严格属于 `["external", "local"]`;`provider: local` 的 fallback 记录不能计为成功执行 |
|
|
419
|
+
|
|
420
|
+
缺字段或取值不在白名单 → Gate MW **FAIL**(不是 SKIP)。
|
|
421
|
+
|
|
422
|
+
**升级后旧证据怎么处置**:唯一正确做法是在当前 HEAD 重跑一次评审、由 runner 重新生成证据文件。
|
|
423
|
+
不要手工给老文件补 `channel` —— 那等于伪造执行证据,而 `channel` 存在的目的正是让证据可追溯到一次真实调用。
|
|
424
|
+
证据本来就与 commit 绑定(`commit` 必须等于 HEAD,有效期 1 小时),跨 commit 复用从来不是受支持的路径。
|
|
425
|
+
|
|
426
|
+
**回滚语义**:validator 与证据生产者(`scripts/delphi-external-review.cjs`)必须成对回滚。
|
|
427
|
+
|
|
428
|
+
- 旧 validator 读新证据:安全,多余字段被忽略。
|
|
429
|
+
- 新 validator 读旧证据:必然 FAIL(缺 `channel`)。这是设计意图——宁可在发布关口停下,
|
|
430
|
+
也不放行一份无法证明模型来源的证据;把「三个不同模型真的跑过」降级为可选项,等于让门禁只剩形式。
|
|
431
|
+
- 临时降级开关:**没有**。既没有 `XP_GATE_SKIP_MW` 之类的环境变量,也不允许 `--no-verify`
|
|
432
|
+
(见 `githooks/QUALITY-GATES-CODE-OF-CONDUCT.md`)。如果评审确实无法完成,处理方式是缩小
|
|
433
|
+
`--range` 或按席位调整 prompt 预算重跑,而不是放行。
|
|
434
|
+
|
|
402
435
|
---
|
|
403
436
|
|
|
404
437
|
## 与现有系统集成
|
|
@@ -190,9 +190,9 @@ Round 2: delphi-review --mode requirements(带 Round 1 gaps 上下文)
|
|
|
190
190
|
"context_file_used": null,
|
|
191
191
|
"round": 1,
|
|
192
192
|
"expert_verdicts": [
|
|
193
|
-
{ "role": "architecture", "verdict": "APPROVED", "confidence": 9, "result_type": "delphi_expert_result", "requested_model": "bailian-tp/qwen-plus" },
|
|
194
|
-
{ "role": "technical", "verdict": "APPROVED", "confidence": 8, "result_type": "delphi_expert_result", "requested_model": "bailian-tp/deepseek-v3" },
|
|
195
|
-
{ "role": "feasibility", "verdict": "APPROVED", "confidence": 8, "result_type": "delphi_expert_result", "requested_model": "bailian-tp/glm-4.5" }
|
|
193
|
+
{ "role": "architecture", "verdict": "APPROVED", "confidence": 9, "result_type": "delphi_expert_result", "requested_model": "bailian-tp/qwen-plus", "resolved_model": "qwen-plus", "channel": "external" },
|
|
194
|
+
{ "role": "technical", "verdict": "APPROVED", "confidence": 8, "result_type": "delphi_expert_result", "requested_model": "bailian-tp/deepseek-v3", "resolved_model": "deepseek-v3", "channel": "external" },
|
|
195
|
+
{ "role": "feasibility", "verdict": "APPROVED", "confidence": 8, "result_type": "delphi_expert_result", "requested_model": "bailian-tp/glm-4.5", "resolved_model": "glm-4.5", "channel": "external" }
|
|
196
196
|
],
|
|
197
197
|
"requirements_statement": "实现用户注册流程,支持邮箱验证和密码重置",
|
|
198
198
|
"gaps_found": [],
|
|
@@ -214,9 +214,9 @@ Round 2: delphi-review --mode requirements(带 Round 1 gaps 上下文)
|
|
|
214
214
|
"context_file_used": null,
|
|
215
215
|
"round": 1,
|
|
216
216
|
"expert_verdicts": [
|
|
217
|
-
{ "role": "architecture", "verdict": "APPROVED", "confidence": 8, "result_type": "delphi_expert_result", "requested_model": "provider/model-a" },
|
|
218
|
-
{ "role": "technical", "verdict": "GAPS_FOUND", "confidence": 7, "result_type": "delphi_expert_result", "requested_model": "provider/model-b" },
|
|
219
|
-
{ "role": "feasibility", "verdict": "APPROVED", "confidence": 8, "result_type": "delphi_expert_result", "requested_model": "provider/model-c" }
|
|
217
|
+
{ "role": "architecture", "verdict": "APPROVED", "confidence": 8, "result_type": "delphi_expert_result", "requested_model": "provider/model-a", "resolved_model": "provider/model-a", "channel": "external" },
|
|
218
|
+
{ "role": "technical", "verdict": "GAPS_FOUND", "confidence": 7, "result_type": "delphi_expert_result", "requested_model": "provider/model-b", "resolved_model": "provider/model-b", "channel": "external" },
|
|
219
|
+
{ "role": "feasibility", "verdict": "APPROVED", "confidence": 8, "result_type": "delphi_expert_result", "requested_model": "provider/model-c", "resolved_model": "provider/model-c", "channel": "external" }
|
|
220
220
|
],
|
|
221
221
|
"requirements_statement": "实现用户注册流程,支持邮箱验证和密码重置",
|
|
222
222
|
"gaps_found": [
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# SKILLS/SPRINT-FLOW KNOWLEDGE BASE
|
|
2
2
|
|
|
3
|
-
**Generated:** 2026-
|
|
4
|
-
**Commit:**
|
|
5
|
-
**Branch:**
|
|
6
|
-
**Version:** 0.
|
|
3
|
+
**Generated:** 2026-10-08
|
|
4
|
+
**Commit:** unknown
|
|
5
|
+
**Branch:** unknown
|
|
6
|
+
**Version:** 0.20.1.0
|
|
7
7
|
|
|
8
8
|
## OVERVIEW
|
|
9
9
|
**6-phase** development pipeline (v2.0 compact redesign, Issue #290): PREP → DESIGN → BUILD → VERIFY → SHIP → CLOSE. Phase 3/6 BUILD default build mode is **ralph-loop** (REQ-level iteration, 40-67% token savings vs parallel). HARD-GATE between DESIGN (2/6) and BUILD (3/6): design must pass Delphi review (≥90% consensus) before any coding.
|
|
@@ -89,9 +89,9 @@ grill 访谈达成共享理解后(或 CONTEXT.md 快速路径下读取已有
|
|
|
89
89
|
"head_commit": "<git rev-parse HEAD>",
|
|
90
90
|
"consensus_ratio": 1.0,
|
|
91
91
|
"expert_verdicts": [
|
|
92
|
-
{ "role": "architecture", "verdict": "APPROVED", "result_type": "delphi_expert_result", "requested_model": "provider/model-a" },
|
|
93
|
-
{ "role": "technical", "verdict": "APPROVED", "result_type": "delphi_expert_result", "requested_model": "provider/model-b" },
|
|
94
|
-
{ "role": "feasibility", "verdict": "APPROVED", "result_type": "delphi_expert_result", "requested_model": "provider/model-c" }
|
|
92
|
+
{ "role": "architecture", "verdict": "APPROVED", "result_type": "delphi_expert_result", "requested_model": "provider/model-a", "resolved_model": "provider/model-a", "channel": "external" },
|
|
93
|
+
{ "role": "technical", "verdict": "APPROVED", "result_type": "delphi_expert_result", "requested_model": "provider/model-b", "resolved_model": "provider/model-b", "channel": "external" },
|
|
94
|
+
{ "role": "feasibility", "verdict": "APPROVED", "result_type": "delphi_expert_result", "requested_model": "provider/model-c", "resolved_model": "provider/model-c", "channel": "external" }
|
|
95
95
|
],
|
|
96
96
|
"rounds": 1,
|
|
97
97
|
"gaps": []
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# SKILLS/TEST-SPECIFICATION-ALIGNMENT KNOWLEDGE BASE
|
|
2
2
|
|
|
3
|
-
**Generated:** 2026-
|
|
4
|
-
**Commit:**
|
|
5
|
-
**Branch:**
|
|
6
|
-
**Version:** 0.
|
|
3
|
+
**Generated:** 2026-10-08
|
|
4
|
+
**Commit:** unknown
|
|
5
|
+
**Branch:** unknown
|
|
6
|
+
**Version:** 0.20.1.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
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
# @boyingliu01/dsh-plugin-xp-gate
|
|
2
2
|
|
|
3
|
-
XP-Gate
|
|
3
|
+
XP-Gate 确定性质量门禁 + AI 工作流技能,作为 **DeepSeek Harness (DSH)** 原生插件(bundle)。
|
|
4
|
+
|
|
5
|
+
> 关联 Issue: #393 设计文档: `docs/plans/2026-08-23-dsh-plugin-design.md`
|
|
6
|
+
> 集成评估: `docs/plans/2026-09-30-dsh-integration-assessment.md`
|
|
4
7
|
|
|
5
8
|
## Tools
|
|
6
9
|
|
|
7
10
|
| Tool | Purpose |
|
|
8
11
|
|------|---------|
|
|
9
12
|
| `gate-check` | Run XP-Gate quality gates (`xp-gate check`) on a file or directory |
|
|
10
|
-
| `gate-principles` | Run the
|
|
13
|
+
| `gate-principles` | Run the Clean Code/SOLID rules (`xp-gate principles`, Gate 4) |
|
|
11
14
|
| `gate-arch` | Run architecture validation (`xp-gate arch`, Gate 6) |
|
|
15
|
+
| `delphi-review` | **多模型交叉评审**:用 3 个不同模型独立评审同一份材料并迭代到共识(见下) |
|
|
12
16
|
|
|
13
17
|
## Install
|
|
14
18
|
|
|
@@ -16,10 +20,171 @@ XP-Gate deterministic quality gates + AI workflow skills as a **DeepSeek Harness
|
|
|
16
20
|
dsh plugin --profile <name> add @boyingliu01/dsh-plugin-xp-gate
|
|
17
21
|
```
|
|
18
22
|
|
|
19
|
-
The tools require a global `xp-gate` CLI:
|
|
23
|
+
The `gate-*` tools require a global `xp-gate` CLI:
|
|
20
24
|
|
|
21
25
|
```bash
|
|
22
26
|
npm install -g @boyingliu01/xp-gate
|
|
23
27
|
```
|
|
24
28
|
|
|
25
|
-
When `xp-gate` is missing
|
|
29
|
+
When `xp-gate` is missing those tools degrade gracefully (tool-missing → SKIP-style message) rather than erroring.
|
|
30
|
+
|
|
31
|
+
## 跨平台:shell 方言层
|
|
32
|
+
|
|
33
|
+
DSH 在非 Windows 上使用 POSIX shell、在 Windows 上使用 **PowerShell executor**
|
|
34
|
+
(`dsh-base` bundle 里 `bash-sandbox` 在 win32 被禁用、`pwsh-sandbox` 启用)。
|
|
35
|
+
|
|
36
|
+
插件最初硬编码 POSIX 命令串,导致三个工具在 Windows 上**全部解析失败**:
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
[stderr] ParserError:
|
|
40
|
+
1 | if command -v xp-gate >/dev/null 2>&1; then xp-gate principles 'D:\pr …
|
|
41
|
+
| ~
|
|
42
|
+
| if语句中的'if'后缺少"(”。
|
|
43
|
+
[exit code: 1]
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
现已按平台生成对应方言(`src/dialect.ts`):
|
|
47
|
+
|
|
48
|
+
| POSIX | PowerShell |
|
|
49
|
+
|-------|-----------|
|
|
50
|
+
| `command -v X` | `Get-Command X -ErrorAction SilentlyContinue` |
|
|
51
|
+
| `printf '%s\n' '...'` | `Write-Output '...'` |
|
|
52
|
+
| `'\''`(单引号转义) | `''`(单引号内双写) |
|
|
53
|
+
|
|
54
|
+
实测(Windows + PowerShell executor):`gate-check` exit 0、`gate-principles` exit 0(`Rules run: 15`)。
|
|
55
|
+
|
|
56
|
+
## 多模型交叉评审(`delphi-review`)
|
|
57
|
+
|
|
58
|
+
### 为什么需要它,而不是用 DSH 的 subagent
|
|
59
|
+
|
|
60
|
+
Delphi 方法的价值**完全建立在「评审者是不同模型」之上**。DSH 的 `subagent` 工具继承宿主
|
|
61
|
+
配置的**单一**模型,因此三个"专家"会是同一个模型的三个实例 —— 按 `delphi-review` skill
|
|
62
|
+
自身的规则必须 BLOCK。
|
|
63
|
+
|
|
64
|
+
所以本工具**直接调用外部 OpenAI 兼容网关**,每个席位绑定一个不同模型。
|
|
65
|
+
|
|
66
|
+
> 另一条路线是打开 DSH 的 `subagentModelSelection`(Web GUI → **Plugins**),让 subagent
|
|
67
|
+
> 也能选模型。两者并不冲突:那条路线让 DSH 原生 subagent 具备多模型能力,本工具则在
|
|
68
|
+
> **不依赖宿主配置**的前提下保证不变量成立(包括 CI / 一次性会话)。
|
|
69
|
+
|
|
70
|
+
### 配置
|
|
71
|
+
|
|
72
|
+
复用项目既有的 `.delphi-config.json`(skill 与工具**同一份配置**):
|
|
73
|
+
|
|
74
|
+
```jsonc
|
|
75
|
+
{
|
|
76
|
+
"active_profile": "whalecloud",
|
|
77
|
+
"profiles": {
|
|
78
|
+
"whalecloud": {
|
|
79
|
+
"providers": {
|
|
80
|
+
"whalecloud": {
|
|
81
|
+
"base_url": "https://<gateway>/gpt-proxy",
|
|
82
|
+
"api_key": "${WHALECLOUD_API_KEY}" // 支持 ${VAR} 与 {env:VAR} 两种写法
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
"experts": { // 对象形式;key 即角色
|
|
86
|
+
"architecture": { "provider": "whalecloud", "model": "g-glm-5.3-flash" },
|
|
87
|
+
"technical": { "provider": "whalecloud", "model": "g-qwen3.8-flash" },
|
|
88
|
+
"feasibility": { "provider": "whalecloud", "model": "g-deepseek-flash" }
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
"consensus": { "threshold_percent": 90, "max_review_rounds": 5 }
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
密钥**只从环境变量读取**,绝不写入配置文件。
|
|
97
|
+
`experts` 同时接受**对象形式**(key 为角色)与**数组形式**(explicit `role` 字段)。
|
|
98
|
+
|
|
99
|
+
### 强制的不变量(代码强制,非文档约定)
|
|
100
|
+
|
|
101
|
+
| 不变量 | 违反时 |
|
|
102
|
+
|---|---|
|
|
103
|
+
| 恰好 3 位专家 | `DelphiConfigError` |
|
|
104
|
+
| 3 个 `requested_model` 去空白后两两不同 | `DelphiConfigError` |
|
|
105
|
+
| 模型不得为未展开的 `${...}` 占位符 | `DelphiConfigError`(在网络调用**之前**) |
|
|
106
|
+
| 缺密钥 / 缺 provider / 专家跨网关 | `DelphiSetupError`,报出变量名而非回显配置 |
|
|
107
|
+
| 报告缺 `### VERDICT` 段 | 记为 `INVALID_NO_VERDICT`,**不计入共识**(绝不从散文里猜裁决) |
|
|
108
|
+
| 退出码 0 但内容为空 | 记为 ERROR(推理模型可能把预算全烧在隐藏 token 上) |
|
|
109
|
+
| 共识按**全体席位数**计算 | 一份畸形报告不能靠其余全票"凑"出共识 |
|
|
110
|
+
|
|
111
|
+
共识阈值为百分比:3 席时 ≥90% 意味着**必须 3/3 通过**。
|
|
112
|
+
|
|
113
|
+
### 轮次语义
|
|
114
|
+
|
|
115
|
+
- **Round 1 匿名且并发**:各席位互不可见。
|
|
116
|
+
- **Round 2+**:回传**汇总票型**(`architecture: APPROVED` …)与"已修改项",
|
|
117
|
+
各席位据此修正或坚持立场。**个体报告始终匿名** —— 只共享计票,这是方法可信的前提。
|
|
118
|
+
- 达到阈值即停;否则到 `max_review_rounds`(默认 5)为止,并如实返回 `NO CONSENSUS`。
|
|
119
|
+
|
|
120
|
+
### 已知行为(实测)
|
|
121
|
+
|
|
122
|
+
用一段**故意有缺陷**的样例代码喂给三个模型,15 次调用(5 轮 × 3 模型)全部成功且
|
|
123
|
+
`resolved_model` 两两不同,三个模型**独立**指出同一个真实缺陷:
|
|
124
|
+
`{ ok: true }` 是**无条件**返回的常量,"把退出码契约换成了一个常量,而不是真正的结果信号"。
|
|
125
|
+
机制**拒绝**给出共识,而不是盖章通过 —— 这正是它该有的行为。
|
|
126
|
+
|
|
127
|
+
## Skills
|
|
128
|
+
|
|
129
|
+
本包在 publish 时通过 `scripts/prepack.cjs` 捆绑仓库 `skills/`(当前 12 个)。
|
|
130
|
+
|
|
131
|
+
要让 DSH 直接看到**仓库版** skill(而非 `~/.agents/skills` 里指向 `~/.qoder/skills` 的 junction),
|
|
132
|
+
运行仓库提供的准备脚本:
|
|
133
|
+
|
|
134
|
+
```powershell
|
|
135
|
+
pwsh -File plugins/dsh/setup-dsh.ps1 # 全部(skill 链接 + 编译 + 提示)
|
|
136
|
+
pwsh -File plugins/dsh/setup-dsh.ps1 -WhatIf # 只预览
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
该脚本在 `$DSH_HOME/skills`(DSH 发现根 rank 400)为仓库每个 skill 建 junction,保持单一真源。
|
|
140
|
+
|
|
141
|
+
> DSH 只读 skill frontmatter 的 6 个字段:`name`、`description`、`whenToUse`、
|
|
142
|
+
> `metadata`、`disable-model-invocation`、`user-invocable`。
|
|
143
|
+
> 本仓库 skill 里的 `allowed-tools` / `hooks` / `triggers` / `maturity` / `auto_continue`
|
|
144
|
+
> **会被静默忽略**(无害,但不生效)。`references/` 子目录可用 —— DSH 的 `skill` 工具返回
|
|
145
|
+
> base directory,模型按需用 read 工具加载。
|
|
146
|
+
|
|
147
|
+
## 备选路线:启用 DSH 原生 subagent 模型选择
|
|
148
|
+
|
|
149
|
+
上面的 `delphi-review` 工具不依赖宿主配置即可保证不变量。若你希望 DSH **原生**
|
|
150
|
+
`subagent` 工具也能指定模型(例如让 Agent Teams 的队友跑不同模型),需显式启用
|
|
151
|
+
(Web GUI → **Plugins** 页面):
|
|
152
|
+
|
|
153
|
+
```
|
|
154
|
+
subagent model selection:
|
|
155
|
+
enabled = true
|
|
156
|
+
allowedModels = [
|
|
157
|
+
{ provider: 'whalecloud', model: 'g-glm-5.3-flash' },
|
|
158
|
+
{ provider: 'whalecloud', model: 'g-qwen3.8-flash' },
|
|
159
|
+
{ provider: 'whalecloud', model: 'g-deepseek-flash' }
|
|
160
|
+
]
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
启用后 `subagent` 工具会新增 `provider` / `model` / `reasoning_effort` 参数,
|
|
164
|
+
并注册 `list_subagent_models` 工具。
|
|
165
|
+
|
|
166
|
+
> 注意:`dsh-tool-subagent` 的 `modelSelectionSettings: true` **只是能力开关**;
|
|
167
|
+
> 实际策略来自宿主设置 `SubagentModelSelectionConfig`(`enabled` 默认 `false`,
|
|
168
|
+
> `allowedModels` 默认 `[]`)。两者都要满足才会生效。
|
|
169
|
+
|
|
170
|
+
## Build
|
|
171
|
+
|
|
172
|
+
```bash
|
|
173
|
+
npm install --ignore-scripts # --ignore-scripts 绕过 esbuild postinstall(受限环境会 EBUSY)
|
|
174
|
+
npm run build # tsc -> lib/
|
|
175
|
+
npm run prepare-skills # 从仓库 skills/ 复制
|
|
176
|
+
npm test # vitest
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
或在仓库根目录:
|
|
180
|
+
|
|
181
|
+
```bash
|
|
182
|
+
npm run build:dsh-plugin # = node scripts/build-plugin.mjs --platform dsh
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
## 注意
|
|
186
|
+
|
|
187
|
+
- `lib/` 与 `skills/` 是**构建产物**(已 gitignore),不提交。
|
|
188
|
+
- `scripts/prepack.cjs` 目前硬编码 12 个 skill,**不含 `clipboard-vision`**(仓库有 13 个)。
|
|
189
|
+
- `plugins/dsh/package.json` 的 peerDeps 仍 pin `0.1.1-rc.2`,但实测运行在 `0.2.0-rc.2` 上
|
|
190
|
+
`defineTool` / `TOOL_ABORTED` / `HarnessError` 签名未变,无需改写。
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# XP-Gate + DSH 集成覆盖层(overlay patch)
|
|
2
|
+
#
|
|
3
|
+
# 用途:为 DeepSeek Harness 启用 Delphi 交叉评审所需的「subagent 模型选择」能力,
|
|
4
|
+
# 并把 XP-Gate 的 skill 根暴露给 DSH。
|
|
5
|
+
#
|
|
6
|
+
# 用法(任选其一):
|
|
7
|
+
# A. 追加到 profile 的用户补丁层:C:\Users\think\.dsh\profiles\web\cordis.patch.yml
|
|
8
|
+
# B. 启动时叠加:dsh --patch <此文件>
|
|
9
|
+
#
|
|
10
|
+
# 说明:DSH 的 patch 语义是「整段替换 config」,不是深合并。
|
|
11
|
+
# 因此这里只声明需要改动的行;agent-preset 的 plugins 行由 preset 自己拥有,
|
|
12
|
+
# 在 profile 层用 id 覆盖它的内部行并不可靠 —— 推荐用 GUI 的 Plugins 页面
|
|
13
|
+
# 设置 subagentModelSelection(见文末),本文件主要用于 skill 根与备用开关。
|
|
14
|
+
|
|
15
|
+
# ── 1. 把仓库 skills/ 暴露给 DSH(项目级,rank 300 custom) ────────────────
|
|
16
|
+
# DSH 默认发现根:<projectRoot>/.dsh/skills (100) → <projectRoot>/.agents/skills (200)
|
|
17
|
+
# → customSkillDirs (300) → ~/.dsh/skills (400) → ~/.agents/skills (500)
|
|
18
|
+
# 当前 ~/.agents/skills 是指向 ~/.qoder/skills 的 junction,所以 DSH 现在加载的是
|
|
19
|
+
# Qoder 版 skill。要改用仓库版本,二选一:
|
|
20
|
+
# (a) 在项目里建 .dsh/skills junction(推荐,见 README-zh.md 的脚本)
|
|
21
|
+
# (b) 在这里加 customSkillDirs
|
|
22
|
+
- id: skill-filesystem
|
|
23
|
+
name: '@deepseek-ai/dsh-skill-filesystem'
|
|
24
|
+
config:
|
|
25
|
+
customSkillDirs:
|
|
26
|
+
- 'D:/projects/xp-gate/skills'
|
|
27
|
+
|
|
28
|
+
# ── 2. 启用 subagent 模型选择(Delphi 三专家不同模型的前提) ────────────────
|
|
29
|
+
# 注意:这一行的 config 会被 GUI Plugins 页面的设置覆盖。
|
|
30
|
+
# enabled 与 allowedModels 是 volatile 的 host 设置,推荐直接在 GUI 里设置:
|
|
31
|
+
#
|
|
32
|
+
# Plugins 页面 → subagent model selection:
|
|
33
|
+
# enabled = true
|
|
34
|
+
# allowedModels = [
|
|
35
|
+
# { provider: whalecloud, model: g-deepseek-v4-pro },
|
|
36
|
+
# { provider: whalecloud, model: g-qwen3.8-max },
|
|
37
|
+
# { provider: whalecloud, model: g-glm-5.3 }
|
|
38
|
+
# ]
|
|
39
|
+
#
|
|
40
|
+
# 启用后,`subagent` 工具会多出 provider / model / reasoning_effort 参数,
|
|
41
|
+
# 并注册 `list_subagent_models` 工具,delphi-review 即可让三个专家使用不同模型。
|
|
42
|
+
#
|
|
43
|
+
# 若偏好用 patch 而非 GUI,取消下面注释(requires @deepseek-ai/dsh-tool-subagent/
|
|
44
|
+
# model-selection-settings,已由 dsh-web-app bundle 在 host 层注册):
|
|
45
|
+
#
|
|
46
|
+
# - id: subagent-model-selection-settings
|
|
47
|
+
# name: '@deepseek-ai/dsh-tool-subagent/model-selection-settings'
|
|
48
|
+
# config:
|
|
49
|
+
# enabled: true
|
|
50
|
+
# allowedModels:
|
|
51
|
+
# - provider: whalecloud
|
|
52
|
+
# model: g-deepseek-v4-pro
|
|
53
|
+
# - provider: whalecloud
|
|
54
|
+
# model: g-qwen3.8-max
|
|
55
|
+
# - provider: whalecloud
|
|
56
|
+
# model: g-glm-5.3
|
|
57
|
+
|
|
58
|
+
# ── 3. (可选)启用 DSH 原生 ralph 工具 ───────────────────────────────────
|
|
59
|
+
# base bundle 默认 disabled(理由:完成与否是 worker 自报,非独立评估)。
|
|
60
|
+
# XP-Gate 的 sprint-flow Phase 2 BUILD 若想用原生 ralph 替代 ralph-loop skill,
|
|
61
|
+
# 在 profile 层恢复它。注意 preset 层已声明该行 id,此处仅作说明:
|
|
62
|
+
#
|
|
63
|
+
# - id: tool-ralph
|
|
64
|
+
# disabled: false
|
|
65
|
+
# config:
|
|
66
|
+
# subagentProvider: spawn
|
|
67
|
+
# maxRounds: 64
|
package/plugins/dsh/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@boyingliu01/dsh-plugin-xp-gate",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.1",
|
|
4
4
|
"description": "XP-Gate deterministic quality gates + AI workflow skills as a DeepSeek Harness (DSH) native plugin: gate-check / gate-principles / gate-arch tools + 12 SKILL.md skills",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/index.js",
|