@boyingliu01/xp-gate 0.33.1 → 0.34.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.
Files changed (49) hide show
  1. package/gate-3.sh +48 -7
  2. package/gate-8.sh +32 -3
  3. package/gate-9.sh +14 -2
  4. package/gates/gate-7.ts +31 -10
  5. package/hooks/gate-3.sh +48 -7
  6. package/hooks/gate-8.sh +32 -3
  7. package/hooks/gate-9.sh +14 -2
  8. package/hooks/lib/assertion-quality.sh +232 -0
  9. package/hooks/lib/diff-coverage.sh +223 -0
  10. package/hooks/pre-commit +226 -2
  11. package/lib/mattpocock-license-verdict.json +1 -1
  12. package/mock-policy/AGENTS.md +2 -2
  13. package/mutation/AGENTS.md +2 -2
  14. package/package.json +1 -1
  15. package/plugins/claude-code/.claude-plugin/plugin.json +1 -1
  16. package/plugins/claude-code/skills/delphi-review/AGENTS.md +2 -2
  17. package/plugins/claude-code/skills/delphi-review/SKILL.md +30 -0
  18. package/plugins/claude-code/skills/sprint-flow/AGENTS.md +2 -2
  19. package/plugins/claude-code/skills/test-driven-development/SKILL.md +19 -0
  20. package/plugins/claude-code/skills/test-driven-development/testing-anti-patterns.md +31 -0
  21. package/plugins/claude-code/skills/test-specification-alignment/AGENTS.md +2 -2
  22. package/plugins/dsh/package.json +1 -1
  23. package/plugins/dsh/skills/delphi-review/AGENTS.md +2 -2
  24. package/plugins/dsh/skills/delphi-review/SKILL.md +30 -0
  25. package/plugins/dsh/skills/sprint-flow/AGENTS.md +2 -2
  26. package/plugins/dsh/skills/test-driven-development/SKILL.md +19 -0
  27. package/plugins/dsh/skills/test-driven-development/testing-anti-patterns.md +31 -0
  28. package/plugins/dsh/skills/test-specification-alignment/AGENTS.md +2 -2
  29. package/plugins/opencode/package.json +1 -1
  30. package/plugins/opencode/skills/delphi-review/AGENTS.md +2 -2
  31. package/plugins/opencode/skills/delphi-review/SKILL.md +30 -0
  32. package/plugins/opencode/skills/sprint-flow/AGENTS.md +2 -2
  33. package/plugins/opencode/skills/test-driven-development/SKILL.md +19 -0
  34. package/plugins/opencode/skills/test-driven-development/testing-anti-patterns.md +31 -0
  35. package/plugins/opencode/skills/test-specification-alignment/AGENTS.md +2 -2
  36. package/plugins/qoder/plugin.json +1 -1
  37. package/plugins/qoder/skills/delphi-review/AGENTS.md +2 -2
  38. package/plugins/qoder/skills/delphi-review/SKILL.md +30 -0
  39. package/plugins/qoder/skills/sprint-flow/AGENTS.md +2 -2
  40. package/plugins/qoder/skills/test-driven-development/SKILL.md +19 -0
  41. package/plugins/qoder/skills/test-driven-development/testing-anti-patterns.md +31 -0
  42. package/plugins/qoder/skills/test-specification-alignment/AGENTS.md +2 -2
  43. package/principles/AGENTS.md +2 -2
  44. package/skills/delphi-review/AGENTS.md +2 -2
  45. package/skills/delphi-review/SKILL.md +30 -0
  46. package/skills/sprint-flow/AGENTS.md +2 -2
  47. package/skills/test-driven-development/SKILL.md +19 -0
  48. package/skills/test-driven-development/testing-anti-patterns.md +31 -0
  49. package/skills/test-specification-alignment/AGENTS.md +2 -2
@@ -281,6 +281,37 @@ TDD cycle:
281
281
  | Tests as afterthought | TDD - tests first |
282
282
  | Over-complex mocks | Consider integration tests |
283
283
 
284
+ ## Which of these does XP-Gate enforce? (Gate 5d, #601)
285
+
286
+ Most of this document is judgement that no linter can make. Six shapes, however,
287
+ are mechanically detectable, and `githooks/lib/assertion-quality.sh` now does it on
288
+ **changed test files only** (未改文件不回溯):
289
+
290
+ | Detector | Shape | Verdict | What to do |
291
+ |----------|-------|---------|------------|
292
+ | `classify_tautological_assertions` | `expect(true).toBe(true)`, `expect(x).toBe(x)\u2011style` literals, `expect(1).toBe(1)`; and a literal tested for the truthiness it already has (`expect(false).toBeFalsy()`) | **BLOCK** | Assert the real value |
293
+ | `classify_swallowed_errors` | `catch {}` / `catch (e) {}` inside a test body | **BLOCK** | Assert the error, or rethrow |
294
+ | `classify_weak_assertions` | A test whose only assertion is `toBeDefined`/`toBeTruthy`/`toBeFalsy`/`toBeNull`/`toBeUndefined`/bare `toHaveBeenCalled()` | WARN | Add a value assertion |
295
+ | `classify_test_focus` | `.only`, `fit`, `fdescribe` | **BLOCK** | Remove it (see below) |
296
+ | `classify_test_skip` | `.skip`, `xit`, `xdescribe`, `test.todo`, `@pytest.mark.skip`, `t.Skip`, `@Disabled`, `@Ignore` | WARN | Justify or un-skip |
297
+ | `classify_deleted_tests` | A test file deleted with no same-named replacement | WARN | Restore it, or say why in the commit body |
298
+
299
+ Why the split: a tautology or an empty catch is **certainly** a test that verifies
300
+ nothing, so it blocks. A `toBeDefined()` alone can be a legitimate structural
301
+ probe, and over-verifying call order can be a real contract, so those warn —
302
+ blocking a legal style just trains people to sprinkle justification annotations
303
+ until the annotations stop meaning anything.
304
+
305
+ **Justification annotations** (all require a reason of at least 10 characters; an
306
+ annotation without a reason is not an exemption):
307
+
308
+ - `// @assertion-justified: <reason>` — exempts one file from Gate 5d.
309
+ - `// @skip-justified: <reason>` — exempts the skipped cases in one file.
310
+ - `XP_GATE_ALLOW_ONLY=1` — per-run override for a focus marker (audited).
311
+
312
+ Every block message names this file, so a reviewer can trace the rule back to the
313
+ anti-pattern it enforces.
314
+
284
315
  ## Red Flags
285
316
 
286
317
  - Assertion checks for `*-mock` test IDs
@@ -1,9 +1,9 @@
1
1
  # SKILLS/TEST-SPECIFICATION-ALIGNMENT KNOWLEDGE BASE
2
2
 
3
3
  **Generated:** 2026-10-30
4
- **Commit:** e713c2d1
4
+ **Commit:** 6ac15e8c
5
5
  **Branch:** main
6
- **Version:** 0.33.1.0
6
+ **Version:** 0.34.0.0
7
7
 
8
8
  ## OVERVIEW
9
9
  Test-Specification Alignment Engine — two-stage validation ensuring tests accurately reflect requirements and design specs.