@boyingliu01/xp-gate 0.23.0 → 0.25.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/adapter-common.sh +51 -2
- package/adapters/python.sh +10 -2
- package/bin/xp-gate.js +15 -1
- package/hooks/adapter-common.sh +51 -2
- package/hooks/lib/coverage-total.sh +20 -0
- package/hooks/lib/python-test-selection.sh +132 -0
- package/hooks/pre-commit +100 -11
- package/lib/__tests__/delphi-setup.test.js +203 -0
- package/lib/__tests__/doctor-delphi.test.js +244 -0
- package/lib/__tests__/init-gitleaks-notice.test.js +57 -0
- package/lib/__tests__/issue-519-phase-transition-guard.test.js +233 -0
- package/lib/__tests__/qoder-delphi-agents.test.js +31 -0
- package/lib/delphi-setup.js +155 -0
- package/lib/doctor.js +269 -1
- package/lib/init.js +49 -1
- package/lib/mattpocock-license-verdict.json +1 -1
- package/lib/phase-transition.js +61 -0
- package/lib/sprint-state-manager.js +86 -39
- package/lib/sprint-state-migrator.js +60 -22
- package/mock-policy/AGENTS.md +3 -3
- package/mutation/AGENTS.md +3 -3
- package/mutation/__tests__/gremlins-runner.test.ts +167 -0
- package/mutation/__tests__/mutmut-runner.test.ts +20 -22
- package/mutation/__tests__/runners-index.test.ts +31 -3
- package/mutation/gate-m.ts +22 -4
- package/mutation/runners/gremlins-runner.ts +238 -0
- package/mutation/runners/index.ts +9 -1
- package/mutation/runners/mutmut-runner.ts +18 -12
- package/mutation/runners/types.ts +20 -0
- package/package.json +1 -1
- package/plugins/claude-code/.claude-plugin/plugin.json +1 -1
- package/plugins/claude-code/skills/delphi-review/.delphi-config.json.example +24 -1
- package/plugins/claude-code/skills/delphi-review/AGENTS.md +3 -3
- package/plugins/claude-code/skills/delphi-review/SKILL.md +43 -0
- package/plugins/claude-code/skills/sprint-flow/AGENTS.md +3 -3
- package/plugins/claude-code/skills/test-specification-alignment/AGENTS.md +3 -3
- package/plugins/dsh/package.json +1 -1
- package/plugins/dsh/skills/delphi-review/.delphi-config.json.example +24 -1
- package/plugins/dsh/skills/delphi-review/AGENTS.md +3 -3
- package/plugins/dsh/skills/delphi-review/SKILL.md +43 -0
- package/plugins/dsh/skills/sprint-flow/AGENTS.md +3 -3
- package/plugins/dsh/skills/test-specification-alignment/AGENTS.md +3 -3
- package/plugins/opencode/package.json +1 -1
- package/plugins/opencode/skills/delphi-review/.delphi-config.json.example +24 -1
- package/plugins/opencode/skills/delphi-review/AGENTS.md +3 -3
- package/plugins/opencode/skills/delphi-review/SKILL.md +43 -0
- package/plugins/opencode/skills/sprint-flow/AGENTS.md +3 -3
- package/plugins/opencode/skills/test-specification-alignment/AGENTS.md +3 -3
- package/plugins/qoder/plugin.json +1 -1
- package/plugins/qoder/skills/delphi-review/.delphi-config.json.example +24 -1
- package/plugins/qoder/skills/delphi-review/AGENTS.md +3 -3
- package/plugins/qoder/skills/delphi-review/SKILL.md +43 -0
- package/plugins/qoder/skills/sprint-flow/AGENTS.md +3 -3
- package/plugins/qoder/skills/test-specification-alignment/AGENTS.md +3 -3
- package/principles/AGENTS.md +3 -3
- package/scripts/delphi-external-review.cjs +166 -14
- package/skills/delphi-review/.delphi-config.json.example +24 -1
- package/skills/delphi-review/AGENTS.md +3 -3
- package/skills/delphi-review/SKILL.md +43 -0
- package/skills/sprint-flow/AGENTS.md +3 -3
- package/skills/test-specification-alignment/AGENTS.md +3 -3
|
@@ -329,6 +329,15 @@ Each round MUST output a structured round marker:
|
|
|
329
329
|
|
|
330
330
|
#### Qoder 平台(Custom Agent 模式 — 只能做到同模型三角色)
|
|
331
331
|
|
|
332
|
+
**通道契约(native-first + external fallback,#414)**:每轮评审开始先探测 native 通道——三个 Custom Agent(`delphi-architecture/technical/feasibility`)是否存在且绑定互异(`xp-gate doctor delphi` 一条命令给出全部判定)。但 **native 通道已被实测证伪**(见下):subagent 派发采纳 agent 提示词、丢弃 model 绑定,三席永远是会话模型。因此 Qoder 的通道决策表实际收敛为:
|
|
333
|
+
|
|
334
|
+
| 探测结果 | 通道 | 处置 |
|
|
335
|
+
|---|---|---|
|
|
336
|
+
| 需要 distinct-models 证据的评审 | **external** | `.delphi-config.json` + `scripts/delphi-external-review.cjs`(外部 provider 三模型) |
|
|
337
|
+
| 仅需同模型三角色自查(不计入共识证据) | native | 三 Custom Agent 并行,报告中注明「同模型自查,不构成多模型凭据」 |
|
|
338
|
+
|
|
339
|
+
降级证据落盘 `delphi-reviewed.json`:`channel`(native/external)、`fallback_reason`(如 `qoder_native_drops_model_binding`)、`probe_evidence`(doctor/日志摘录)。两通道同不变量:三专家齐全、`requested_model` 互异(external)、consensus ≥90%、**无单专家路径**。
|
|
340
|
+
|
|
332
341
|
Qoder 的内置模型**没有本地推理端点**:推理请求由 Qoder 客户端经服务端代理发出,凭证是一次性 job token。所以不能照搬 OpenCode 的 `base_url + api_key` 直连方式;Qoder 侧内置模型的唯一入口是 **Custom Agent** —— 每个专家一个独立 agent 文件,frontmatter 用 `model` 字段声明模型。
|
|
333
342
|
|
|
334
343
|
**契约结论(先说结论)**:这条路径**不满足**"三个不同可执行模型 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` 绑定。
|
|
@@ -408,6 +417,20 @@ delphi-review(
|
|
|
408
417
|
> (1) `dsh-tool-subagent` 的 `modelSelectionSettings: true`(仅能力开关),
|
|
409
418
|
> (2) 宿主设置 `SubagentModelSelectionConfig.enabled = true` 且 `allowedModels` ≥3 个不同模型。
|
|
410
419
|
> 该路线依赖宿主配置,CI / 一次性会话不可靠,故不作为默认路径。
|
|
420
|
+
|
|
421
|
+
**DSH 双通道契约(native-first + external fallback,#443)**:评审开始先探测 native 通道,两层开关缺一不可——
|
|
422
|
+
|
|
423
|
+
| 探测步骤 | 方法 | 判定 |
|
|
424
|
+
|---|---|---|
|
|
425
|
+
| ① 工具 schema | 当前会话 `subagent` 工具的参数里是否暴露 `provider` / `model` 字段 | 无 → native 不可用(`enabled` 默认 `false`) |
|
|
426
|
+
| ② 模型清单 | `list_subagent_models` 工具是否注册;可用时返回条数是否 ≥3 且互异 | 未注册或 <3 条 → native 不可用 |
|
|
427
|
+
| ③ 运行时兜底 | 上述任一不满足时调用 subagent 会抛 `child model selection is disabled` | 直接判定,不试错 |
|
|
428
|
+
|
|
429
|
+
- **native 可用**:三个专家并行派发,每个显式传 `model`(取自 `allowedModels` 三个互异条目);`resolved_model` 以平台日志/回执为准,无日志时按 #437 过渡标准注明「执行层验证待平台支持」。
|
|
430
|
+
- **native 不可用**:降级 **external**(本 skill 的 `delphi-review` 插件工具,或 `.delphi-config.json` + `scripts/delphi-external-review.cjs`)。缺 API key 时必须给出明确指引(导出环境变量),不得静默失败。
|
|
431
|
+
- 降级证据落盘 `delphi-reviewed.json`:`channel`、`fallback_reason`(如 `dsh_subagent_model_selection_disabled`)、`probe_evidence`(①②③ 的实测摘录)。
|
|
432
|
+
- 两通道同不变量:三专家齐全、`requested_model` 互异、consensus ≥90%、**无单专家路径**。
|
|
433
|
+
- 可用性探测可用 `xp-gate doctor delphi` 复核(DSH 环境下含 `subagentModelSelection` 持久化设置检查)。
|
|
411
434
|
#### WorkBuddy 平台(Expert 团队模式)
|
|
412
435
|
|
|
413
436
|
WorkBuddy 侧以 Team 型专家团(示例:`delphi-review-team`,安装在 `~/.workbuddy/plugins/marketplaces/my-experts/plugins/`,创建方式见 [docs/platform-workbuddy.md](../../docs/platform-workbuddy.md))承载评审,触发本技能后按此路由执行:
|
|
@@ -432,6 +455,26 @@ WorkBuddy 侧以 Team 型专家团(示例:`delphi-review-team`,安装在 `
|
|
|
432
455
|
|
|
433
456
|
**成本**:3 专家合计 x0.17/轮;主理人选 local 会话模型则零 credits。
|
|
434
457
|
|
|
458
|
+
### 席位 prompt 上限与降序裁剪(强制 — #481)
|
|
459
|
+
|
|
460
|
+
prompt 字节上限是 **席位×模型路由 属性**,不是全局安全值(2026-10-05 实测:同一网关下
|
|
461
|
+
`g-glm-5.3-flash` 席 32-39KB 连续 6 次断连,他席 36KB 一次通过)。编排规则:
|
|
462
|
+
|
|
463
|
+
1. **发送前硬闸**:runner 按 expert 条目的 `max_prompt_bytes`(默认 40000 字节,UTF-8 计)
|
|
464
|
+
拒发超限请求,输出 `error_type: "prompt_budget_exceeded"`。
|
|
465
|
+
2. **失败分类**:响应前断连且字节数超过该席位标定的 `last_pass_bytes` →
|
|
466
|
+
`error_type: "SIZE_EXCEEDED"`(不是网络故障,重试同一 payload 无意义);
|
|
467
|
+
其余失败输出 `network_error` / `retryable_error`,编排层按 `error_type` 字段断言,不解析散文。
|
|
468
|
+
3. **超限时按降序裁剪,每步只做一步**:
|
|
469
|
+
① 去附录(探针填充、日志附录、非必需长引用)→ ② 去非本轮 AC 原文 →
|
|
470
|
+
③ 去测试清单(枚举 → 计数)→ ④ 拆分两次调用(按 diff 对半,同报告合并)→
|
|
471
|
+
⑤ 仍失败 → `PROCESS_BLOCK` 交人裁定。**不得以两席结果冒充 3/3 共识。**
|
|
472
|
+
4. **标定**:上限按「固定语义核心 + 确定性填充附录」构造探针,在
|
|
473
|
+
`[last_pass, last_fail]` 区间二分 3-5 次测得;记录行含
|
|
474
|
+
`seat_id × model_id × gateway × max_passing_bytes × measured_at`;
|
|
475
|
+
模型或网关变更即重标。协议全文与种子标定表见
|
|
476
|
+
[docs/plans/2026-10-14-sprint-c-design.md](../../docs/plans/2026-10-14-sprint-c-design.md) §2。
|
|
477
|
+
|
|
435
478
|
### 共识阈值
|
|
436
479
|
|
|
437
480
|
| 阈值 | 说明 |
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# SKILLS/SPRINT-FLOW KNOWLEDGE BASE
|
|
2
2
|
|
|
3
|
-
**Generated:** 2026-10-
|
|
4
|
-
**Commit:**
|
|
3
|
+
**Generated:** 2026-10-14
|
|
4
|
+
**Commit:** a757d625
|
|
5
5
|
**Branch:** main
|
|
6
|
-
**Version:** 0.
|
|
6
|
+
**Version:** 0.25.0.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.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# SKILLS/TEST-SPECIFICATION-ALIGNMENT KNOWLEDGE BASE
|
|
2
2
|
|
|
3
|
-
**Generated:** 2026-10-
|
|
4
|
-
**Commit:**
|
|
3
|
+
**Generated:** 2026-10-14
|
|
4
|
+
**Commit:** a757d625
|
|
5
5
|
**Branch:** main
|
|
6
|
-
**Version:** 0.
|
|
6
|
+
**Version:** 0.25.0.0
|
|
7
7
|
|
|
8
8
|
## OVERVIEW
|
|
9
9
|
Test-Specification Alignment Engine — two-stage validation ensuring tests accurately reflect requirements and design specs.
|