@boyingliu01/xp-gate 0.38.9 → 0.38.11
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/shell.sh +87 -2
- package/hooks/gate-entries/gate-0-entry.sh +48 -3
- package/hooks/gate-entries/gate-12-entry.sh +20 -1
- package/hooks/gate-entries/gate-5-entry.sh +56 -2
- package/hooks/pre-commit +40 -0
- package/lib/__tests__/baseline-completeness.test.js +264 -0
- package/lib/baseline.js +265 -86
- package/lib/mattpocock-license-verdict.json +1 -1
- package/mock-policy/AGENTS.md +85 -83
- package/mutation/AGENTS.md +87 -61
- package/package.json +1 -1
- package/plugins/claude-code/.claude-plugin/plugin.json +1 -1
- package/plugins/claude-code/skills/delphi-review/AGENTS.md +1 -1
- package/plugins/claude-code/skills/ralph-loop/SKILL.md +1 -1
- package/plugins/claude-code/skills/ralph-loop/references/components.md +1 -1
- package/plugins/claude-code/skills/sprint-flow/AGENTS.md +3 -3
- package/plugins/claude-code/skills/sprint-flow/__tests__/sprint-flow.test.cjs +25 -7
- package/plugins/claude-code/skills/sprint-flow/references/phase-overview.md +3 -3
- package/plugins/claude-code/skills/test-specification-alignment/AGENTS.md +1 -1
- package/plugins/dsh/package.json +1 -1
- package/plugins/dsh/skills/delphi-review/AGENTS.md +1 -1
- package/plugins/dsh/skills/ralph-loop/SKILL.md +1 -1
- package/plugins/dsh/skills/ralph-loop/references/components.md +1 -1
- package/plugins/dsh/skills/sprint-flow/AGENTS.md +3 -3
- package/plugins/dsh/skills/sprint-flow/__tests__/sprint-flow.test.cjs +25 -7
- package/plugins/dsh/skills/sprint-flow/references/phase-overview.md +3 -3
- package/plugins/dsh/skills/test-specification-alignment/AGENTS.md +1 -1
- package/plugins/opencode/package.json +1 -1
- package/plugins/opencode/skills/delphi-review/AGENTS.md +1 -1
- package/plugins/opencode/skills/ralph-loop/SKILL.md +1 -1
- package/plugins/opencode/skills/ralph-loop/references/components.md +1 -1
- package/plugins/opencode/skills/sprint-flow/AGENTS.md +3 -3
- package/plugins/opencode/skills/sprint-flow/__tests__/sprint-flow.test.cjs +25 -7
- package/plugins/opencode/skills/sprint-flow/references/phase-overview.md +3 -3
- package/plugins/opencode/skills/test-specification-alignment/AGENTS.md +1 -1
- package/plugins/qoder/plugin.json +1 -1
- package/plugins/qoder/skills/delphi-review/AGENTS.md +1 -1
- package/plugins/qoder/skills/ralph-loop/SKILL.md +1 -1
- package/plugins/qoder/skills/ralph-loop/references/components.md +1 -1
- package/plugins/qoder/skills/sprint-flow/AGENTS.md +3 -3
- package/plugins/qoder/skills/sprint-flow/__tests__/sprint-flow.test.cjs +25 -7
- package/plugins/qoder/skills/sprint-flow/references/phase-overview.md +3 -3
- package/plugins/qoder/skills/test-specification-alignment/AGENTS.md +1 -1
- package/principles/AGENTS.md +103 -97
- package/skills/delphi-review/AGENTS.md +1 -1
- package/skills/ralph-loop/SKILL.md +1 -1
- package/skills/ralph-loop/references/components.md +1 -1
- package/skills/sprint-flow/AGENTS.md +3 -3
- package/skills/sprint-flow/references/phase-overview.md +3 -3
- package/skills/test-specification-alignment/AGENTS.md +1 -1
|
@@ -27,14 +27,14 @@ Sprint Flow is NOT just a sequential launcher of existing skills. Here's what ma
|
|
|
27
27
|
|-----------|-----------------|-------------|
|
|
28
28
|
| **Context Continuity** | Each skill starts fresh; lost design decisions between phases | Phase summaries + sprint-state.json maintain full traceability across 6 phases |
|
|
29
29
|
| **Gate Enforcement** | No enforcement — easy to skip Delphi, skip TDD, skip UAT | HARD-GATE: design must be APPROVED (≥90% Delphi consensus) before coding; UAT is mandatory (no bypass) |
|
|
30
|
-
| **
|
|
30
|
+
| **Context Growth** | Linear context accumulation across phases — one growing shared context | Ralph-loop default: each REQ starts from a clean context instead of inheriting everything before it |
|
|
31
31
|
| **Emergent Requirements** | Discovered late, silently ignored or merged | Phase 6 CLOSE explicitly captures emergent issues via template; triggers Sprint 2 for critical issues |
|
|
32
32
|
| **Quality Ecosystem** | No integration with quality gates | Integrated with xp-gate's full quality ecosystem: Gate 5 (coverage), Gate M2 (mock density), Delphi code-walkthrough |
|
|
33
33
|
| **Progress Tracking** | Ad-hoc, memory-based | `.sprint-state/` persistence with phase history, timing, and metrics — `--status` renders progress dashboard |
|
|
34
34
|
|
|
35
35
|
### Key Differentiators
|
|
36
36
|
|
|
37
|
-
1. **
|
|
37
|
+
1. **No Cross-REQ Context Accumulation via Ralph Loop**: Phase 3 BUILD default (`ralph-loop`) processes one REQ at a time with a clean context, instead of carrying every earlier REQ in one growing context as parallel mode does. The benefit is qualitative — earlier REQs stop competing for room with the current one — and no measured token figure is claimed here.
|
|
38
38
|
|
|
39
39
|
2. **HARD-GATE Discipline**: Design must pass Delphi review with all three expert roles executed successfully, three distinct requested model IDs verified, and ≥90% aggregate consensus within five rounds before Phase 3 BUILD can start. This is enforced both in SKILL.md instructions and via the Claude Code plugin's PreToolUse hook.
|
|
40
40
|
|
|
@@ -190,7 +190,7 @@ Sprint Flow: PREP → DESIGN → BUILD → VERIFY → SHIP → CLOSE
|
|
|
190
190
|
2. **DELPHI-GATE**: 验证 `.sprint-state/delphi-reviewed.json` 存在且 `verdict = "APPROVED"` → 否则 BLOCK
|
|
191
191
|
3. **TDD-GATE (MANDATORY — v0.14.0+)**: 在 delegation 前验证每个 REQ 存在 failing test。无 test → mark `[TDD-RED]`(ralph-loop 创建)。有 test 且 GREEN 且无实现 → BLOCK(TDD bypass)。详见 `references/phase-3-build.md#tdd-gate-pre-implementation-tdd-check-mandatory`。
|
|
192
192
|
4. **输入**: `slices-manifest.json`(Phase 2/6 生成),按 `execution_order` 逐个执行
|
|
193
|
-
5. **模式**: 默认 `ralph-loop`(逐 REQ
|
|
193
|
+
5. **模式**: 默认 `ralph-loop`(逐 REQ 迭代,每个 REQ 独立干净上下文,不与之前的 REQ 累积),可选 `--mode parallel`
|
|
194
194
|
6. **Skill 步骤**: BUILD-ENTRY-CONTRACT → hooks-install → TDD-GATE → TDD (RED/GREEN/REFACTOR) → blind-review (read-only subagent, tools: [Read, Grep, Glob]) → verification-before-completion → 成本监控 → learnings.md 写入
|
|
195
195
|
7. **Mock Minimization**: integration-first, mock 仅限 external services, 密度 > 30% 需 `@mock-justified`
|
|
196
196
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
**Generated:** 2026-11-04
|
|
4
4
|
**Commit:** eb2097b0
|
|
5
5
|
**Branch:** sprint/2026-11-03-02
|
|
6
|
-
**Version:** 0.38.
|
|
6
|
+
**Version:** 0.38.11.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.38.
|
|
3
|
+
"version": "0.38.11",
|
|
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": {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
**Generated:** 2026-11-04
|
|
4
4
|
**Commit:** eb2097b0
|
|
5
5
|
**Branch:** sprint/2026-11-03-02
|
|
6
|
-
**Version:** 0.38.
|
|
6
|
+
**Version:** 0.38.11.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.
|
|
@@ -7,7 +7,7 @@ maturity: stable
|
|
|
7
7
|
|
|
8
8
|
# Ralph Loop — Default REQ-Level Iterative Build
|
|
9
9
|
|
|
10
|
-
Core principles: **isolated context per REQ**, **TDD-first**, **full regression every iteration**, **
|
|
10
|
+
Core principles: **isolated context per REQ**, **TDD-first**, **full regression every iteration**, **no cross-REQ context accumulation** (each REQ starts clean instead of inheriting an ever-growing shared context).
|
|
11
11
|
|
|
12
12
|
## Triggers
|
|
13
13
|
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
| # | 原则 | 说明 |
|
|
6
6
|
|---|------|------|
|
|
7
7
|
| 1 | 逐 REQ 迭代 | 一次处理一个 REQ/切片,干净上下文,避免上下文线性膨胀 |
|
|
8
|
-
| 2 |
|
|
8
|
+
| 2 | 上下文不累积 | 比旧的并行模式少一层**线性累积**:并行模式下所有 REQ 共享同一条不断变长的上下文,逐 REQ 模式每个 REQ 从干净上下文开始 |
|
|
9
9
|
| 3 | 全量回归 | 每个 REQ 完成后跑全量测试 |
|
|
10
10
|
| 4 | 进度持久化 | progress.log 持久化 learnings/permanent/contextual |
|
|
11
11
|
| 5 | 可中断续传 | 中断后可从最后完成 REQ 继续 |
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
**Generated:** 2026-11-04
|
|
4
4
|
**Commit:** eb2097b0
|
|
5
5
|
**Branch:** sprint/2026-11-03-02
|
|
6
|
-
**Version:** 0.38.
|
|
6
|
+
**Version:** 0.38.11.0
|
|
7
7
|
|
|
8
8
|
## OVERVIEW
|
|
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
|
|
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; each REQ starts from a clean context instead of accumulating one across REQs). HARD-GATE between DESIGN (2/6) and BUILD (3/6): design must pass Delphi review (≥90% consensus) before any coding.
|
|
10
10
|
|
|
11
11
|
> **v2.0 Compact Redesign (Issue #290)**: Merged from 11 phases to 6. PREP = old ISOLATE + AUTO-ESTIMATE. DESIGN = old THINK + PLAN. BUILD = old BUILD. VERIFY = old REVIEW + FEEDBACK. SHIP = old SHIP + LAND. CLOSE = old USER ACCEPTANCE + CLEANUP.
|
|
12
12
|
|
|
@@ -63,7 +63,7 @@ skills/sprint-flow/
|
|
|
63
63
|
| 6/6 | CLOSE | USER ACCEPT + CLEANUP | Manual UAT → emergent issues → cleanup | HARD-GATE: UAT mandatory manual |
|
|
64
64
|
|
|
65
65
|
## CONVENTIONS
|
|
66
|
-
- **ralph-loop is Phase 3/6 BUILD default**. Each REQ runs in a clean context,
|
|
66
|
+
- **ralph-loop is Phase 3/6 BUILD default**. Each REQ runs in a clean context, so context does not accumulate across REQs.
|
|
67
67
|
- **delphi-review HARD-GATE in Phase 2/6 DESIGN**: all three expert roles must execute with three distinct requested model IDs, then aggregate ≥90% consensus within 5 rounds. Unapproved or unverifiable → BLOCK coding.
|
|
68
68
|
- **`learn` is called twice**: once per REQ in Phase 3/6 (ralph-loop internal) and once in Phase 4/6 VERIFY (Sprint-level retro).
|
|
69
69
|
- **Phase isolation**: each phase has explicit entry/exit criteria documented in its `references/phase-*.md` file.
|
|
@@ -260,12 +260,30 @@ function testUniqueValuePropositionExists() {
|
|
|
260
260
|
console.log(' ✓ Unique Value Proposition section exists');
|
|
261
261
|
}
|
|
262
262
|
|
|
263
|
-
function
|
|
263
|
+
function testUvpMentionsContextIsolation() {
|
|
264
264
|
const section = contentSplit('Unique Value Proposition');
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
265
|
+
// Guards the MECHANISM, not a number. This assertion used to require the
|
|
266
|
+
// literal '40' and '67' -- a figure with no measurement behind it anywhere in
|
|
267
|
+
// the repo, copied between docs and pinned here so it could never be corrected.
|
|
268
|
+
// What actually distinguishes ralph-loop is that a REQ starts from a clean
|
|
269
|
+
// context instead of inheriting one: that is checkable and does not rot.
|
|
270
|
+
const mentionsIsolation =
|
|
271
|
+
/clean context|context (?:does not|doesn't) accumulate|no cross-REQ context accumulation|Context Growth/i.test(
|
|
272
|
+
section
|
|
273
|
+
);
|
|
274
|
+
if (!mentionsIsolation) {
|
|
275
|
+
throw new Error(
|
|
276
|
+
'Unique Value Proposition must explain the per-REQ clean-context mechanism'
|
|
277
|
+
);
|
|
278
|
+
}
|
|
279
|
+
// And it must not resurrect an unsourced percentage as if it were measured.
|
|
280
|
+
const unsourcedPercentage = /\b\d{1,3}\s*[-–]\s*\d{1,3}%\s*(?:token|Token)/.test(section);
|
|
281
|
+
if (unsourcedPercentage) {
|
|
282
|
+
throw new Error(
|
|
283
|
+
'UVP states a token-savings percentage range; no measurement backs it, so do not reinstate one without data'
|
|
284
|
+
);
|
|
285
|
+
}
|
|
286
|
+
console.log(' ✓ UVP explains per-REQ clean context without an unsourced figure');
|
|
269
287
|
}
|
|
270
288
|
|
|
271
289
|
function testUvpMentionsHardGate() {
|
|
@@ -353,7 +371,7 @@ function runTests(opts = {}) {
|
|
|
353
371
|
{ name: 'force-levels.md exists with three levels', fn: testForceLevelsDocumentExists },
|
|
354
372
|
{ name: 'force-levels.md requires Delphi review', fn: testForceLevelsRequiresDelphi },
|
|
355
373
|
{ name: 'Unique Value Proposition exists', fn: testUniqueValuePropositionExists },
|
|
356
|
-
{ name: 'UVP
|
|
374
|
+
{ name: 'UVP explains per-REQ clean context (no unsourced figure)', fn: testUvpMentionsContextIsolation },
|
|
357
375
|
{ name: 'UVP mentions HARD-GATE', fn: testUvpMentionsHardGate },
|
|
358
376
|
{ name: 'UVP mentions emergent requirements', fn: testUvpMentionsEmergentRequirements },
|
|
359
377
|
{ name: 'Timing & Stability section exists', fn: testTimingSectionExists },
|
|
@@ -436,7 +454,7 @@ describe('sprint-flow SKILL.md', () => {
|
|
|
436
454
|
{ name: 'force-levels.md exists with three levels', fn: testForceLevelsDocumentExists },
|
|
437
455
|
{ name: 'force-levels.md requires Delphi review', fn: testForceLevelsRequiresDelphi },
|
|
438
456
|
{ name: 'Unique Value Proposition exists', fn: testUniqueValuePropositionExists },
|
|
439
|
-
{ name: 'UVP
|
|
457
|
+
{ name: 'UVP explains per-REQ clean context (no unsourced figure)', fn: testUvpMentionsContextIsolation },
|
|
440
458
|
{ name: 'UVP mentions HARD-GATE', fn: testUvpMentionsHardGate },
|
|
441
459
|
{ name: 'UVP mentions emergent requirements', fn: testUvpMentionsEmergentRequirements },
|
|
442
460
|
{ name: 'Timing & Stability section exists', fn: testTimingSectionExists },
|
|
@@ -27,14 +27,14 @@ Sprint Flow is NOT just a sequential launcher of existing skills. Here's what ma
|
|
|
27
27
|
|-----------|-----------------|-------------|
|
|
28
28
|
| **Context Continuity** | Each skill starts fresh; lost design decisions between phases | Phase summaries + sprint-state.json maintain full traceability across 6 phases |
|
|
29
29
|
| **Gate Enforcement** | No enforcement — easy to skip Delphi, skip TDD, skip UAT | HARD-GATE: design must be APPROVED (≥90% Delphi consensus) before coding; UAT is mandatory (no bypass) |
|
|
30
|
-
| **
|
|
30
|
+
| **Context Growth** | Linear context accumulation across phases — one growing shared context | Ralph-loop default: each REQ starts from a clean context instead of inheriting everything before it |
|
|
31
31
|
| **Emergent Requirements** | Discovered late, silently ignored or merged | Phase 6 CLOSE explicitly captures emergent issues via template; triggers Sprint 2 for critical issues |
|
|
32
32
|
| **Quality Ecosystem** | No integration with quality gates | Integrated with xp-gate's full quality ecosystem: Gate 5 (coverage), Gate M2 (mock density), Delphi code-walkthrough |
|
|
33
33
|
| **Progress Tracking** | Ad-hoc, memory-based | `.sprint-state/` persistence with phase history, timing, and metrics — `--status` renders progress dashboard |
|
|
34
34
|
|
|
35
35
|
### Key Differentiators
|
|
36
36
|
|
|
37
|
-
1. **
|
|
37
|
+
1. **No Cross-REQ Context Accumulation via Ralph Loop**: Phase 3 BUILD default (`ralph-loop`) processes one REQ at a time with a clean context, instead of carrying every earlier REQ in one growing context as parallel mode does. The benefit is qualitative — earlier REQs stop competing for room with the current one — and no measured token figure is claimed here.
|
|
38
38
|
|
|
39
39
|
2. **HARD-GATE Discipline**: Design must pass Delphi review with all three expert roles executed successfully, three distinct requested model IDs verified, and ≥90% aggregate consensus within five rounds before Phase 3 BUILD can start. This is enforced both in SKILL.md instructions and via the Claude Code plugin's PreToolUse hook.
|
|
40
40
|
|
|
@@ -190,7 +190,7 @@ Sprint Flow: PREP → DESIGN → BUILD → VERIFY → SHIP → CLOSE
|
|
|
190
190
|
2. **DELPHI-GATE**: 验证 `.sprint-state/delphi-reviewed.json` 存在且 `verdict = "APPROVED"` → 否则 BLOCK
|
|
191
191
|
3. **TDD-GATE (MANDATORY — v0.14.0+)**: 在 delegation 前验证每个 REQ 存在 failing test。无 test → mark `[TDD-RED]`(ralph-loop 创建)。有 test 且 GREEN 且无实现 → BLOCK(TDD bypass)。详见 `references/phase-3-build.md#tdd-gate-pre-implementation-tdd-check-mandatory`。
|
|
192
192
|
4. **输入**: `slices-manifest.json`(Phase 2/6 生成),按 `execution_order` 逐个执行
|
|
193
|
-
5. **模式**: 默认 `ralph-loop`(逐 REQ
|
|
193
|
+
5. **模式**: 默认 `ralph-loop`(逐 REQ 迭代,每个 REQ 独立干净上下文,不与之前的 REQ 累积),可选 `--mode parallel`
|
|
194
194
|
6. **Skill 步骤**: BUILD-ENTRY-CONTRACT → hooks-install → TDD-GATE → TDD (RED/GREEN/REFACTOR) → blind-review (read-only subagent, tools: [Read, Grep, Glob]) → verification-before-completion → 成本监控 → learnings.md 写入
|
|
195
195
|
7. **Mock Minimization**: integration-first, mock 仅限 external services, 密度 > 30% 需 `@mock-justified`
|
|
196
196
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
**Generated:** 2026-11-04
|
|
4
4
|
**Commit:** eb2097b0
|
|
5
5
|
**Branch:** sprint/2026-11-03-02
|
|
6
|
-
**Version:** 0.38.
|
|
6
|
+
**Version:** 0.38.11.0
|
|
7
7
|
|
|
8
8
|
## OVERVIEW
|
|
9
9
|
Test-Specification Alignment Engine — two-stage validation ensuring tests accurately reflect requirements and design specs.
|
package/principles/AGENTS.md
CHANGED
|
@@ -1,112 +1,118 @@
|
|
|
1
1
|
# PRINCIPLES CHECKER MODULE
|
|
2
2
|
|
|
3
|
-
**
|
|
4
|
-
**Commit:** eb2097b0
|
|
5
|
-
**Branch:** sprint/2026-11-03-02
|
|
6
|
-
**Version:** 0.38.9.0
|
|
3
|
+
**Updated:** 2026-11-17
|
|
7
4
|
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
> **Scope.** This is the TypeScript engine behind the Clean-Code/SOLID gate and
|
|
6
|
+
> the Boy Scout enforcement. What follows is the design intent and the rules you
|
|
7
|
+
> cannot read off the code.
|
|
8
|
+
>
|
|
9
|
+
> Rule lists, adapter counts and file trees were here before and were wrong: the
|
|
10
|
+
> doc claimed "9 language adapters" in three places while the directory held
|
|
11
|
+
> more, and that wrong figure propagated outward into the CLI's own hardcoded
|
|
12
|
+
> help text. Ask the code:
|
|
13
|
+
>
|
|
14
|
+
> | Question | Answer |
|
|
15
|
+
> |---|---|
|
|
16
|
+
> | Every rule, its severity and limit | `xp-gate gate-rules` |
|
|
17
|
+
> | Rule implementations | `rules/clean-code/`, `rules/solid/` |
|
|
18
|
+
> | Language coverage | `adapters/` (language adapters sit beside shared helpers — see TRAPS) |
|
|
19
|
+
> | Effective thresholds | `.principlesrc` plus built-in defaults |
|
|
10
20
|
|
|
11
|
-
##
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
21
|
+
## DESIGN INTENT
|
|
22
|
+
|
|
23
|
+
### Two tiers of language coverage, and the divergence is deliberate
|
|
24
|
+
|
|
25
|
+
This engine only covers languages it can **parse meaningfully**. The shell
|
|
26
|
+
adapters cover languages it can **lint or test**. The two sets do not match, and
|
|
27
|
+
that mismatch is correct: a language with no TS-side rule support still gets
|
|
28
|
+
gated, just by different means. Do not "close the gap" by inventing shallow
|
|
29
|
+
adapters — a rule that reports noise is worse than no rule.
|
|
30
|
+
|
|
31
|
+
### Rules are IDs, and IDs are contracts
|
|
32
|
+
|
|
33
|
+
Rule IDs are dot-namespaced and stable (`clean-code.long-function`,
|
|
34
|
+
`solid.srp`). They appear in config, in baselines, in SARIF and in suppression
|
|
35
|
+
records. Renaming one silently invalidates every baseline entry that referenced
|
|
36
|
+
it — the warning count appears to drop because the rule no longer matches, not
|
|
37
|
+
because the code improved.
|
|
38
|
+
|
|
39
|
+
### Severity has three meanings
|
|
40
|
+
|
|
41
|
+
- `error` — blocks.
|
|
42
|
+
- `warning` — blocks under Boy Scout **if the count increased**.
|
|
43
|
+
- `info` — logged only.
|
|
44
|
+
|
|
45
|
+
The middle one is the subtle case: a warning does not block, but *one more of
|
|
46
|
+
them than yesterday* does. This is why baselines are load-bearing.
|
|
47
|
+
|
|
48
|
+
### Boy Scout is differential, not absolute
|
|
49
|
+
|
|
50
|
+
The rule is not "no warnings". It is: **you may not leave more warnings than you
|
|
51
|
+
found.** Modified files are compared against the baseline; new files start from
|
|
52
|
+
zero. That comparison is what makes the gate adoptable in an imperfect codebase —
|
|
53
|
+
an absolute rule would block all work immediately and be switched off within a
|
|
54
|
+
day.
|
|
55
|
+
|
|
56
|
+
Consequence worth knowing: the baseline must be regenerated when rule behaviour
|
|
57
|
+
changes legitimately, or every subsequent commit inherits phantom debt.
|
|
46
58
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
59
|
+
### Per-path severity overrides exist, and only relax
|
|
60
|
+
|
|
61
|
+
Project config may relax a rule's severity for specific path globs. Overrides are
|
|
62
|
+
**relax-only by design**: a path-scoped entry can downgrade, never escalate. That
|
|
63
|
+
direction is what keeps the override mechanism from becoming a second, invisible
|
|
64
|
+
gate policy — anything that raises severity must be visible in the rule
|
|
65
|
+
definition, where a reviewer will see it.
|
|
66
|
+
|
|
67
|
+
This exists because the alternative was worse: without it, projects add blanket
|
|
68
|
+
suppressions for test trees, which also silence production code.
|
|
69
|
+
|
|
70
|
+
### Parse where possible, regex where necessary, and say which
|
|
71
|
+
|
|
72
|
+
AST-based analysis is preferred. Regex fallbacks are limited to languages the AST
|
|
73
|
+
tooling does not reach (C/C++, Objective-C), where they are **known to be
|
|
74
|
+
approximate**. A regex adapter that reports a confident finding it cannot verify
|
|
75
|
+
is the failure mode to avoid — prefer under-reporting to fabricating.
|
|
76
|
+
|
|
77
|
+
## TRAPS
|
|
78
|
+
|
|
79
|
+
- **`adapters/` holds two kinds of file.** Language adapters sit beside shared
|
|
80
|
+
extraction helpers (`base`, `duplication`, `member-scan`, `quote-state`,
|
|
81
|
+
`control-nesting`, `import-clause`, `position-analysis`). Counting files in that
|
|
82
|
+
directory does not give a language count — which is exactly how the "9
|
|
83
|
+
language adapters" figure went wrong.
|
|
84
|
+
- **C++ handles C.** There is no separate C adapter; one adapter covers both. Do
|
|
85
|
+
not add one.
|
|
86
|
+
- **Suppression is easy to over-apply.** A config entry that turns off a rule for
|
|
87
|
+
a directory also turns it off for everything added there later.
|
|
88
|
+
- **Baselines go stale.** A baseline captured before a rule change encodes the old
|
|
89
|
+
rule's opinions; comparing against it produces findings that have nothing to do
|
|
90
|
+
with the change under review.
|
|
91
|
+
- **The extension point is the rule registry in `index.ts`.** A rule file that
|
|
92
|
+
exists but is not registered simply never runs, silently.
|
|
74
93
|
|
|
75
94
|
## CONVENTIONS
|
|
76
|
-
|
|
77
|
-
- **
|
|
78
|
-
-
|
|
79
|
-
|
|
80
|
-
- **
|
|
81
|
-
|
|
82
|
-
- **
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
- Do NOT skip `ast-grep` installation — regex fallback is intentionally limited.
|
|
88
|
-
- Do NOT introduce a new rule without: (a) ID under `rules/<category>/`, (b) unit tests, (c) listing in `index.ts`, (d) SARIF rule description in `reporter.ts`.
|
|
89
|
-
|
|
90
|
-
## UNIQUE STYLES
|
|
91
|
-
- **9 language adapters** here vs **13 shell adapters** in `githooks/adapters/` — divergence is intentional. Principles engine covers what can be parsed; shell adapters cover what can be linted/tested. Languages in shell-only set (shell, powershell, flutter, iac) don't have TS-side rule support.
|
|
92
|
-
- **C++ adapter handles C** via regex — no standalone `c.ts`.
|
|
93
|
-
- **SARIF 2.1.0** chosen for GitHub Code Scanning compatibility.
|
|
95
|
+
|
|
96
|
+
- **Never weaken types to satisfy a rule** — no `as any`, `@ts-ignore`,
|
|
97
|
+
`@ts-expect-error` in rule implementations. The analyzer is trusted by every
|
|
98
|
+
gate that reads its output.
|
|
99
|
+
- **Every test declares its traceability tags** (`@test REQ-XXX`, `@intent`,
|
|
100
|
+
`@covers`); untagged tests are rejected.
|
|
101
|
+
- **Mocks are inline**, not fixture files — a rule test should read as one
|
|
102
|
+
self-contained claim about one rule.
|
|
103
|
+
- **New rules are four-part changes**: the implementation, its tests, its
|
|
104
|
+
registration, and its user-facing description. Any three without the fourth
|
|
105
|
+
produces a rule nobody can interpret.
|
|
94
106
|
|
|
95
107
|
## COMMANDS
|
|
108
|
+
|
|
96
109
|
```bash
|
|
97
|
-
# Console output
|
|
98
110
|
npx tsx src/principles/index.ts --files "src/**/*.ts" --format console
|
|
99
|
-
|
|
100
|
-
# SARIF for GitHub Actions
|
|
101
111
|
npx tsx src/principles/index.ts --files "src/**/*.ts" --format sarif > results.sarif
|
|
102
|
-
|
|
103
|
-
# Custom config
|
|
104
112
|
npx tsx src/principles/index.ts --files "src/**/*.ts" --config .principlesrc
|
|
105
113
|
```
|
|
106
114
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
- `getAllRules()` is the stable extension point — register new rules there.
|
|
112
|
-
|
|
115
|
+
Output formats exist because two different consumers read the same findings: a
|
|
116
|
+
human at a terminal and a code-scanning service ingesting SARIF. Keep both
|
|
117
|
+
faithful to the same verdict — a rule that reports differently through the two
|
|
118
|
+
channels is worse than one that reports only one.
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
**Generated:** 2026-11-04
|
|
4
4
|
**Commit:** eb2097b0
|
|
5
5
|
**Branch:** sprint/2026-11-03-02
|
|
6
|
-
**Version:** 0.38.
|
|
6
|
+
**Version:** 0.38.11.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.
|
|
@@ -7,7 +7,7 @@ maturity: stable
|
|
|
7
7
|
|
|
8
8
|
# Ralph Loop — Default REQ-Level Iterative Build
|
|
9
9
|
|
|
10
|
-
Core principles: **isolated context per REQ**, **TDD-first**, **full regression every iteration**, **
|
|
10
|
+
Core principles: **isolated context per REQ**, **TDD-first**, **full regression every iteration**, **no cross-REQ context accumulation** (each REQ starts clean instead of inheriting an ever-growing shared context).
|
|
11
11
|
|
|
12
12
|
## Triggers
|
|
13
13
|
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
| # | 原则 | 说明 |
|
|
6
6
|
|---|------|------|
|
|
7
7
|
| 1 | 逐 REQ 迭代 | 一次处理一个 REQ/切片,干净上下文,避免上下文线性膨胀 |
|
|
8
|
-
| 2 |
|
|
8
|
+
| 2 | 上下文不累积 | 比旧的并行模式少一层**线性累积**:并行模式下所有 REQ 共享同一条不断变长的上下文,逐 REQ 模式每个 REQ 从干净上下文开始 |
|
|
9
9
|
| 3 | 全量回归 | 每个 REQ 完成后跑全量测试 |
|
|
10
10
|
| 4 | 进度持久化 | progress.log 持久化 learnings/permanent/contextual |
|
|
11
11
|
| 5 | 可中断续传 | 中断后可从最后完成 REQ 继续 |
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
**Generated:** 2026-11-04
|
|
4
4
|
**Commit:** eb2097b0
|
|
5
5
|
**Branch:** sprint/2026-11-03-02
|
|
6
|
-
**Version:** 0.38.
|
|
6
|
+
**Version:** 0.38.11.0
|
|
7
7
|
|
|
8
8
|
## OVERVIEW
|
|
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
|
|
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; each REQ starts from a clean context instead of accumulating one across REQs). HARD-GATE between DESIGN (2/6) and BUILD (3/6): design must pass Delphi review (≥90% consensus) before any coding.
|
|
10
10
|
|
|
11
11
|
> **v2.0 Compact Redesign (Issue #290)**: Merged from 11 phases to 6. PREP = old ISOLATE + AUTO-ESTIMATE. DESIGN = old THINK + PLAN. BUILD = old BUILD. VERIFY = old REVIEW + FEEDBACK. SHIP = old SHIP + LAND. CLOSE = old USER ACCEPTANCE + CLEANUP.
|
|
12
12
|
|
|
@@ -63,7 +63,7 @@ skills/sprint-flow/
|
|
|
63
63
|
| 6/6 | CLOSE | USER ACCEPT + CLEANUP | Manual UAT → emergent issues → cleanup | HARD-GATE: UAT mandatory manual |
|
|
64
64
|
|
|
65
65
|
## CONVENTIONS
|
|
66
|
-
- **ralph-loop is Phase 3/6 BUILD default**. Each REQ runs in a clean context,
|
|
66
|
+
- **ralph-loop is Phase 3/6 BUILD default**. Each REQ runs in a clean context, so context does not accumulate across REQs.
|
|
67
67
|
- **delphi-review HARD-GATE in Phase 2/6 DESIGN**: all three expert roles must execute with three distinct requested model IDs, then aggregate ≥90% consensus within 5 rounds. Unapproved or unverifiable → BLOCK coding.
|
|
68
68
|
- **`learn` is called twice**: once per REQ in Phase 3/6 (ralph-loop internal) and once in Phase 4/6 VERIFY (Sprint-level retro).
|
|
69
69
|
- **Phase isolation**: each phase has explicit entry/exit criteria documented in its `references/phase-*.md` file.
|
|
@@ -27,14 +27,14 @@ Sprint Flow is NOT just a sequential launcher of existing skills. Here's what ma
|
|
|
27
27
|
|-----------|-----------------|-------------|
|
|
28
28
|
| **Context Continuity** | Each skill starts fresh; lost design decisions between phases | Phase summaries + sprint-state.json maintain full traceability across 6 phases |
|
|
29
29
|
| **Gate Enforcement** | No enforcement — easy to skip Delphi, skip TDD, skip UAT | HARD-GATE: design must be APPROVED (≥90% Delphi consensus) before coding; UAT is mandatory (no bypass) |
|
|
30
|
-
| **
|
|
30
|
+
| **Context Growth** | Linear context accumulation across phases — one growing shared context | Ralph-loop default: each REQ starts from a clean context instead of inheriting everything before it |
|
|
31
31
|
| **Emergent Requirements** | Discovered late, silently ignored or merged | Phase 6 CLOSE explicitly captures emergent issues via template; triggers Sprint 2 for critical issues |
|
|
32
32
|
| **Quality Ecosystem** | No integration with quality gates | Integrated with xp-gate's full quality ecosystem: Gate 5 (coverage), Gate M2 (mock density), Delphi code-walkthrough |
|
|
33
33
|
| **Progress Tracking** | Ad-hoc, memory-based | `.sprint-state/` persistence with phase history, timing, and metrics — `--status` renders progress dashboard |
|
|
34
34
|
|
|
35
35
|
### Key Differentiators
|
|
36
36
|
|
|
37
|
-
1. **
|
|
37
|
+
1. **No Cross-REQ Context Accumulation via Ralph Loop**: Phase 3 BUILD default (`ralph-loop`) processes one REQ at a time with a clean context, instead of carrying every earlier REQ in one growing context as parallel mode does. The benefit is qualitative — earlier REQs stop competing for room with the current one — and no measured token figure is claimed here.
|
|
38
38
|
|
|
39
39
|
2. **HARD-GATE Discipline**: Design must pass Delphi review with all three expert roles executed successfully, three distinct requested model IDs verified, and ≥90% aggregate consensus within five rounds before Phase 3 BUILD can start. This is enforced both in SKILL.md instructions and via the Claude Code plugin's PreToolUse hook.
|
|
40
40
|
|
|
@@ -190,7 +190,7 @@ Sprint Flow: PREP → DESIGN → BUILD → VERIFY → SHIP → CLOSE
|
|
|
190
190
|
2. **DELPHI-GATE**: 验证 `.sprint-state/delphi-reviewed.json` 存在且 `verdict = "APPROVED"` → 否则 BLOCK
|
|
191
191
|
3. **TDD-GATE (MANDATORY — v0.14.0+)**: 在 delegation 前验证每个 REQ 存在 failing test。无 test → mark `[TDD-RED]`(ralph-loop 创建)。有 test 且 GREEN 且无实现 → BLOCK(TDD bypass)。详见 `references/phase-3-build.md#tdd-gate-pre-implementation-tdd-check-mandatory`。
|
|
192
192
|
4. **输入**: `slices-manifest.json`(Phase 2/6 生成),按 `execution_order` 逐个执行
|
|
193
|
-
5. **模式**: 默认 `ralph-loop`(逐 REQ
|
|
193
|
+
5. **模式**: 默认 `ralph-loop`(逐 REQ 迭代,每个 REQ 独立干净上下文,不与之前的 REQ 累积),可选 `--mode parallel`
|
|
194
194
|
6. **Skill 步骤**: BUILD-ENTRY-CONTRACT → hooks-install → TDD-GATE → TDD (RED/GREEN/REFACTOR) → blind-review (read-only subagent, tools: [Read, Grep, Glob]) → verification-before-completion → 成本监控 → learnings.md 写入
|
|
195
195
|
7. **Mock Minimization**: integration-first, mock 仅限 external services, 密度 > 30% 需 `@mock-justified`
|
|
196
196
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
**Generated:** 2026-11-04
|
|
4
4
|
**Commit:** eb2097b0
|
|
5
5
|
**Branch:** sprint/2026-11-03-02
|
|
6
|
-
**Version:** 0.38.
|
|
6
|
+
**Version:** 0.38.11.0
|
|
7
7
|
|
|
8
8
|
## OVERVIEW
|
|
9
9
|
Test-Specification Alignment Engine — two-stage validation ensuring tests accurately reflect requirements and design specs.
|