@boyingliu01/xp-gate 0.35.19 → 0.35.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/hooks/pre-commit +58 -12
  2. package/lib/__tests__/sprint-status-rework-704.test.js +149 -0
  3. package/lib/__tests__/sprint-status-rework.test.js +32 -7
  4. package/lib/__tests__/test-alignment-java-702.test.ts +182 -0
  5. package/lib/__tests__/test-alignment.test.ts +6 -2
  6. package/lib/mattpocock-license-verdict.json +1 -1
  7. package/lib/sprint-status.js +91 -26
  8. package/lib/test-alignment.ts +152 -6
  9. package/mock-policy/AGENTS.md +3 -3
  10. package/mutation/AGENTS.md +3 -3
  11. package/package.json +1 -1
  12. package/plugins/claude-code/.claude-plugin/plugin.json +1 -1
  13. package/plugins/claude-code/skills/delphi-review/AGENTS.md +3 -3
  14. package/plugins/claude-code/skills/sprint-flow/AGENTS.md +3 -3
  15. package/plugins/claude-code/skills/test-specification-alignment/AGENTS.md +3 -3
  16. package/plugins/dsh/lib/index.d.ts +24 -0
  17. package/plugins/dsh/lib/index.d.ts.map +1 -1
  18. package/plugins/dsh/lib/index.js +37 -1
  19. package/plugins/dsh/package.json +1 -1
  20. package/plugins/dsh/skills/delphi-review/AGENTS.md +3 -3
  21. package/plugins/dsh/skills/sprint-flow/AGENTS.md +3 -3
  22. package/plugins/dsh/skills/test-specification-alignment/AGENTS.md +3 -3
  23. package/plugins/dsh/src/delphi-version-footer.test.ts +42 -0
  24. package/plugins/dsh/src/index.ts +38 -1
  25. package/plugins/opencode/package.json +1 -1
  26. package/plugins/opencode/skills/delphi-review/AGENTS.md +3 -3
  27. package/plugins/opencode/skills/sprint-flow/AGENTS.md +3 -3
  28. package/plugins/opencode/skills/test-specification-alignment/AGENTS.md +3 -3
  29. package/plugins/qoder/plugin.json +1 -1
  30. package/plugins/qoder/skills/delphi-review/AGENTS.md +3 -3
  31. package/plugins/qoder/skills/sprint-flow/AGENTS.md +3 -3
  32. package/plugins/qoder/skills/test-specification-alignment/AGENTS.md +3 -3
  33. package/principles/AGENTS.md +3 -3
  34. package/skills/delphi-review/AGENTS.md +3 -3
  35. package/skills/sprint-flow/AGENTS.md +3 -3
  36. package/skills/test-specification-alignment/AGENTS.md +3 -3
@@ -0,0 +1,42 @@
1
+ import { describe, it, expect } from "vitest"
2
+ import { readFileSync } from "node:fs"
3
+ import { resolve } from "node:path"
4
+ import { fileURLToPath } from "node:url"
5
+
6
+ import { formatPluginFooter, pluginVersion } from "./index.js"
7
+
8
+ /**
9
+ * @test REQ-709
10
+ * @intent `delphi-review` 的输出里没有任何版本信息,于是"修复没生效"与"修复没做"
11
+ * 无法区分。本 issue 的发现过程就是代价:对一份设计连续评审 4 次全部
12
+ * 只拿到票型、拿不到意见正文,据此判定设计有实质缺陷并两次重写;改用
13
+ * 源码渠道拿到真实意见后,第 2 轮就达成 100% 共识——那 4 次"不通过"
14
+ * 里至少有一部分是我本来就没错,但**无法区分"错"与"没通过"**。
15
+ *
16
+ * 这类缺陷在本仓库已有先例:#451(hook 漂移,doctor --sync-hooks 解决)、
17
+ * #681(skill 内容漂移)。共同形状是「运行的东西与你以为在运行的东西
18
+ * 不一致,且没有任何机制告诉你」。一行版本号就能消掉一整类排查。
19
+ *
20
+ * 断言必须能失败:如果 footer 里只是硬编码一个字符串,版本升级后它就
21
+ * 开始撒谎——所以测试把它与 package.json 的真实 version 对齐。
22
+ * @covers AC-709-01, AC-709-02
23
+ */
24
+
25
+ const PKG_ROOT = resolve(fileURLToPath(new URL("..", import.meta.url)))
26
+ const PKG_VERSION = (JSON.parse(readFileSync(resolve(PKG_ROOT, "package.json"), "utf8")) as { version: string }).version
27
+
28
+ describe("delphi 输出暴露插件版本 (#709)", () => {
29
+ it("AC-709-01: the version comes from package.json, not a hardcoded literal", () => {
30
+ // If this ever drifts, the footer is lying about which code is running —
31
+ // which is the whole defect this guards against.
32
+ expect(pluginVersion()).toBe(PKG_VERSION)
33
+ })
34
+
35
+ it("AC-709-02: the footer names the plugin version so a stale load is visible", () => {
36
+ const footer = formatPluginFooter("whalecloud", "A, B, C")
37
+ expect(footer).toContain(`plugin: ${PKG_VERSION}`)
38
+ // The pre-existing fields must survive: this is an addition, not a rewrite.
39
+ expect(footer).toContain("Provider: whalecloud")
40
+ expect(footer).toContain("Seats: A, B, C")
41
+ })
42
+ })
@@ -1,4 +1,5 @@
1
1
  import { writeFile } from "node:fs/promises"
2
+ import { createRequire } from "node:module"
2
3
  import { join } from "node:path"
3
4
  import { fileURLToPath } from "node:url"
4
5
 
@@ -328,6 +329,42 @@ export function findPlaceholderName(value: string): string | undefined {
328
329
  return envStyle ? envStyle[1] : undefined
329
330
  }
330
331
 
332
+ /**
333
+ * The running plugin's version, read from its own package.json (#709).
334
+ *
335
+ * Delphi's tool result used to carry no version at all, which made "the fix did
336
+ * not take effect" indistinguishable from "the fix was never made". That cost a
337
+ * real investigation: four design reviews returned verdicts without a single
338
+ * line of expert reasoning, the design was rewritten twice on the assumption it
339
+ * must be wrong, and the same reviews reached 100% consensus on round two once
340
+ * the reasoning was readable. Nothing was wrong with the design.
341
+ *
342
+ * Read rather than injected so dev runs and packed installs report the same
343
+ * thing, and so a stale load is visible as an old number instead of silence.
344
+ * Falls back to "unknown" rather than throwing: a version banner must never be
345
+ * the reason a review fails to start.
346
+ */
347
+ export function pluginVersion(): string {
348
+ try {
349
+ const require_ = createRequire(import.meta.url)
350
+ const pkg = require_("../package.json") as { version?: string }
351
+ return typeof pkg.version === "string" && pkg.version !== "" ? pkg.version : "unknown"
352
+ } catch {
353
+ return "unknown"
354
+ }
355
+ }
356
+
357
+ /**
358
+ * The provider/seats banner that closes every Delphi tool result (#709).
359
+ *
360
+ * Extracted from the inline template so the version claim has exactly one
361
+ * definition — and so it can be asserted against package.json instead of being
362
+ * pinned to a literal that silently starts lying at the next release.
363
+ */
364
+ export function formatPluginFooter(provider: string, described: string): string {
365
+ return `Provider: ${provider} | plugin: ${pluginVersion()}\nSeats: ${described}`
366
+ }
367
+
331
368
  async function runDelphiReview(subject: string, request: ReviewRequest): Promise<string> {
332
369
  const { addressed, cwd, resolveApiKey, signal, writeEvidence } = request
333
370
  try {
@@ -336,7 +373,7 @@ async function runDelphiReview(subject: string, request: ReviewRequest): Promise
336
373
  const suffix = writeEvidence && cfg !== undefined
337
374
  ? await writeWalkthroughEvidence(cwd, cfg, outcome)
338
375
  : ""
339
- return `${formatOutcome(outcome)}\n\nProvider: ${provider}\nSeats: ${described}${suffix}`
376
+ return `${formatOutcome(outcome)}\n\n${formatPluginFooter(provider, described)}${suffix}`
340
377
  } catch (e) {
341
378
  // Config problems are the common failure; report them as guidance
342
379
  // rather than a stack trace.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@boyingliu01/opencode-plugin",
3
- "version": "0.35.19",
3
+ "version": "0.35.20",
4
4
  "type": "module",
5
5
  "main": "index.ts",
6
6
  "description": "XP-Gate quality gates + AI workflow skills for OpenCode",
@@ -1,9 +1,9 @@
1
1
  # SKILLS/DELPHI-REVIEW KNOWLEDGE BASE
2
2
 
3
- **Generated:** 2026-11-01
4
- **Commit:** effea31d
3
+ **Generated:** 2026-11-02
4
+ **Commit:** 60545e49
5
5
  **Branch:** main
6
- **Version:** 0.35.19.0
6
+ **Version:** 0.35.20.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.
@@ -1,9 +1,9 @@
1
1
  # SKILLS/SPRINT-FLOW KNOWLEDGE BASE
2
2
 
3
- **Generated:** 2026-11-01
4
- **Commit:** effea31d
3
+ **Generated:** 2026-11-02
4
+ **Commit:** 60545e49
5
5
  **Branch:** main
6
- **Version:** 0.35.19.0
6
+ **Version:** 0.35.20.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-11-01
4
- **Commit:** effea31d
3
+ **Generated:** 2026-11-02
4
+ **Commit:** 60545e49
5
5
  **Branch:** main
6
- **Version:** 0.35.19.0
6
+ **Version:** 0.35.20.0
7
7
 
8
8
  ## OVERVIEW
9
9
  Test-Specification Alignment Engine — two-stage validation ensuring tests accurately reflect requirements and design specs.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xp-gate",
3
- "version": "0.35.19",
3
+ "version": "0.35.20",
4
4
  "displayName": "XP-Gate",
5
5
  "description": "Extreme Programming quality gates + AI workflow skills for Qoder. Includes 12 pre-commit gates (Gate 0-11), 8 pre-push gates, Sprint Flow (6 phases), and Delphi multi-expert review (>=90% consensus).",
6
6
  "author": {
@@ -1,9 +1,9 @@
1
1
  # SKILLS/DELPHI-REVIEW KNOWLEDGE BASE
2
2
 
3
- **Generated:** 2026-11-01
4
- **Commit:** effea31d
3
+ **Generated:** 2026-11-02
4
+ **Commit:** 60545e49
5
5
  **Branch:** main
6
- **Version:** 0.35.19.0
6
+ **Version:** 0.35.20.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.
@@ -1,9 +1,9 @@
1
1
  # SKILLS/SPRINT-FLOW KNOWLEDGE BASE
2
2
 
3
- **Generated:** 2026-11-01
4
- **Commit:** effea31d
3
+ **Generated:** 2026-11-02
4
+ **Commit:** 60545e49
5
5
  **Branch:** main
6
- **Version:** 0.35.19.0
6
+ **Version:** 0.35.20.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-11-01
4
- **Commit:** effea31d
3
+ **Generated:** 2026-11-02
4
+ **Commit:** 60545e49
5
5
  **Branch:** main
6
- **Version:** 0.35.19.0
6
+ **Version:** 0.35.20.0
7
7
 
8
8
  ## OVERVIEW
9
9
  Test-Specification Alignment Engine — two-stage validation ensuring tests accurately reflect requirements and design specs.
@@ -1,9 +1,9 @@
1
1
  # PRINCIPLES CHECKER MODULE
2
2
 
3
- **Generated:** 2026-11-01
4
- **Commit:** effea31d
3
+ **Generated:** 2026-11-02
4
+ **Commit:** 60545e49
5
5
  **Branch:** main
6
- **Version:** 0.35.19.0
6
+ **Version:** 0.35.20.0
7
7
 
8
8
  ## OVERVIEW
9
9
  Clean Code & SOLID principles checker — **Gate 4** of pre-commit. 14 rules × 9 language adapters, SARIF 2.1.0 output. Houses the **Boy Scout Rule** enforcement engine (Gate 6) and warning-baseline storage.
@@ -1,9 +1,9 @@
1
1
  # SKILLS/DELPHI-REVIEW KNOWLEDGE BASE
2
2
 
3
- **Generated:** 2026-11-01
4
- **Commit:** effea31d
3
+ **Generated:** 2026-11-02
4
+ **Commit:** 60545e49
5
5
  **Branch:** main
6
- **Version:** 0.35.19.0
6
+ **Version:** 0.35.20.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.
@@ -1,9 +1,9 @@
1
1
  # SKILLS/SPRINT-FLOW KNOWLEDGE BASE
2
2
 
3
- **Generated:** 2026-11-01
4
- **Commit:** effea31d
3
+ **Generated:** 2026-11-02
4
+ **Commit:** 60545e49
5
5
  **Branch:** main
6
- **Version:** 0.35.19.0
6
+ **Version:** 0.35.20.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-11-01
4
- **Commit:** effea31d
3
+ **Generated:** 2026-11-02
4
+ **Commit:** 60545e49
5
5
  **Branch:** main
6
- **Version:** 0.35.19.0
6
+ **Version:** 0.35.20.0
7
7
 
8
8
  ## OVERVIEW
9
9
  Test-Specification Alignment Engine — two-stage validation ensuring tests accurately reflect requirements and design specs.