@su-record/vibe 2.12.5 → 2.14.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 (139) hide show
  1. package/CLAUDE.md +25 -16
  2. package/README.en.md +16 -14
  3. package/README.md +13 -11
  4. package/dist/cli/postinstall/constants.d.ts.map +1 -1
  5. package/dist/cli/postinstall/constants.js +1 -0
  6. package/dist/cli/postinstall/constants.js.map +1 -1
  7. package/dist/cli/postinstall/fs-utils.d.ts +23 -0
  8. package/dist/cli/postinstall/fs-utils.d.ts.map +1 -1
  9. package/dist/cli/postinstall/fs-utils.js +71 -0
  10. package/dist/cli/postinstall/fs-utils.js.map +1 -1
  11. package/dist/cli/postinstall/fs-utils.test.js +69 -1
  12. package/dist/cli/postinstall/fs-utils.test.js.map +1 -1
  13. package/dist/cli/postinstall/main.d.ts.map +1 -1
  14. package/dist/cli/postinstall/main.js +12 -2
  15. package/dist/cli/postinstall/main.js.map +1 -1
  16. package/dist/cli/setup/CodexHooks.test.js +27 -0
  17. package/dist/cli/setup/CodexHooks.test.js.map +1 -1
  18. package/dist/cli/setup/ProjectSetup.d.ts.map +1 -1
  19. package/dist/cli/setup/ProjectSetup.js +6 -5
  20. package/dist/cli/setup/ProjectSetup.js.map +1 -1
  21. package/dist/infra/lib/DecisionTracer.d.ts +4 -0
  22. package/dist/infra/lib/DecisionTracer.d.ts.map +1 -1
  23. package/dist/infra/lib/DecisionTracer.js +4 -0
  24. package/dist/infra/lib/DecisionTracer.js.map +1 -1
  25. package/dist/infra/lib/LoopBreaker.d.ts +4 -0
  26. package/dist/infra/lib/LoopBreaker.d.ts.map +1 -1
  27. package/dist/infra/lib/LoopBreaker.js +4 -0
  28. package/dist/infra/lib/LoopBreaker.js.map +1 -1
  29. package/dist/infra/lib/ReviewRace.d.ts +4 -0
  30. package/dist/infra/lib/ReviewRace.d.ts.map +1 -1
  31. package/dist/infra/lib/ReviewRace.js +4 -0
  32. package/dist/infra/lib/ReviewRace.js.map +1 -1
  33. package/dist/infra/lib/SkillQualityGate.d.ts +4 -0
  34. package/dist/infra/lib/SkillQualityGate.d.ts.map +1 -1
  35. package/dist/infra/lib/SkillQualityGate.js +4 -0
  36. package/dist/infra/lib/SkillQualityGate.js.map +1 -1
  37. package/dist/infra/lib/UltraQA.d.ts +4 -0
  38. package/dist/infra/lib/UltraQA.d.ts.map +1 -1
  39. package/dist/infra/lib/UltraQA.js +4 -0
  40. package/dist/infra/lib/UltraQA.js.map +1 -1
  41. package/dist/infra/lib/VerificationLoop.d.ts +4 -0
  42. package/dist/infra/lib/VerificationLoop.d.ts.map +1 -1
  43. package/dist/infra/lib/VerificationLoop.js +4 -0
  44. package/dist/infra/lib/VerificationLoop.js.map +1 -1
  45. package/dist/infra/orchestrator/index.d.ts.map +1 -1
  46. package/dist/infra/orchestrator/index.js +1 -3
  47. package/dist/infra/orchestrator/index.js.map +1 -1
  48. package/dist/infra/orchestrator/parallelResearch.d.ts.map +1 -1
  49. package/dist/infra/orchestrator/parallelResearch.js +1 -4
  50. package/dist/infra/orchestrator/parallelResearch.js.map +1 -1
  51. package/dist/tools/convention/validateCodeQuality.d.ts.map +1 -1
  52. package/dist/tools/convention/validateCodeQuality.js +5 -4
  53. package/dist/tools/convention/validateCodeQuality.js.map +1 -1
  54. package/dist/tools/index.d.ts +2 -0
  55. package/dist/tools/index.d.ts.map +1 -1
  56. package/dist/tools/index.js +2 -0
  57. package/dist/tools/index.js.map +1 -1
  58. package/dist/tools/loop/index.d.ts +6 -0
  59. package/dist/tools/loop/index.d.ts.map +1 -0
  60. package/dist/tools/loop/index.js +5 -0
  61. package/dist/tools/loop/index.js.map +1 -0
  62. package/dist/tools/loop/validateLoopDefinition.d.ts +38 -0
  63. package/dist/tools/loop/validateLoopDefinition.d.ts.map +1 -0
  64. package/dist/tools/loop/validateLoopDefinition.js +224 -0
  65. package/dist/tools/loop/validateLoopDefinition.js.map +1 -0
  66. package/dist/tools/loop/validateLoopDefinition.test.d.ts +14 -0
  67. package/dist/tools/loop/validateLoopDefinition.test.d.ts.map +1 -0
  68. package/dist/tools/loop/validateLoopDefinition.test.js +229 -0
  69. package/dist/tools/loop/validateLoopDefinition.test.js.map +1 -0
  70. package/dist/tools/spec/traceabilityMatrix.d.ts +2 -0
  71. package/dist/tools/spec/traceabilityMatrix.d.ts.map +1 -1
  72. package/dist/tools/spec/traceabilityMatrix.js +50 -1
  73. package/dist/tools/spec/traceabilityMatrix.js.map +1 -1
  74. package/dist/tools/spec/traceabilityMatrix.path-resolution.test.d.ts +10 -0
  75. package/dist/tools/spec/traceabilityMatrix.path-resolution.test.d.ts.map +1 -0
  76. package/dist/tools/spec/traceabilityMatrix.path-resolution.test.js +89 -0
  77. package/dist/tools/spec/traceabilityMatrix.path-resolution.test.js.map +1 -0
  78. package/dist/tools/spec/traceabilityMatrix.test.js +19 -0
  79. package/dist/tools/spec/traceabilityMatrix.test.js.map +1 -1
  80. package/hooks/hooks.json +1 -0
  81. package/hooks/scripts/__tests__/.vibe/command-log.txt +60 -0
  82. package/hooks/scripts/__tests__/.vibe/memories/memories.db +0 -0
  83. package/hooks/scripts/__tests__/.vibe/memories/memories.db-shm +0 -0
  84. package/hooks/scripts/__tests__/.vibe/memories/memories.db-wal +0 -0
  85. package/hooks/scripts/__tests__/auto-test-debounce.test.js +145 -0
  86. package/hooks/scripts/__tests__/code-check-detectors.test.js +155 -0
  87. package/hooks/scripts/__tests__/dispatcher-inprocess.test.js +99 -0
  88. package/hooks/scripts/__tests__/keyword-detector.test.js +26 -18
  89. package/hooks/scripts/__tests__/loop-ledger.test.js +321 -0
  90. package/hooks/scripts/__tests__/post-edit-dispatcher.test.js +139 -0
  91. package/hooks/scripts/__tests__/pre-tool-guard.test.js +115 -1
  92. package/hooks/scripts/__tests__/run-ledger-verify-required.test.js +146 -0
  93. package/hooks/scripts/__tests__/run-ledger.test.js +330 -0
  94. package/hooks/scripts/__tests__/scope-from-spec.test.js +215 -0
  95. package/hooks/scripts/__tests__/sentinel-guard.test.js +79 -24
  96. package/hooks/scripts/__tests__/step-counter.test.js +95 -15
  97. package/hooks/scripts/__tests__/utils-npm-root.test.js +98 -0
  98. package/hooks/scripts/auto-commit.js +27 -1
  99. package/hooks/scripts/auto-format.js +85 -20
  100. package/hooks/scripts/auto-test.js +187 -37
  101. package/hooks/scripts/code-check.js +286 -90
  102. package/hooks/scripts/codex-hook-adapter.js +12 -1
  103. package/hooks/scripts/command-log.js +26 -16
  104. package/hooks/scripts/keyword-detector.js +22 -22
  105. package/hooks/scripts/lib/dispatcher.js +38 -0
  106. package/hooks/scripts/lib/hook-context.js +130 -0
  107. package/hooks/scripts/lib/loop-ledger.js +118 -0
  108. package/hooks/scripts/lib/pr-gate-runner.js +62 -0
  109. package/hooks/scripts/lib/run-ledger.js +169 -0
  110. package/hooks/scripts/lib/scope-from-spec.js +40 -7
  111. package/hooks/scripts/loop-ledger.js +56 -0
  112. package/hooks/scripts/post-edit-dispatcher.js +93 -20
  113. package/hooks/scripts/post-edit.js +40 -19
  114. package/hooks/scripts/pr-test-gate.js +8 -37
  115. package/hooks/scripts/pre-tool-dispatcher.js +18 -16
  116. package/hooks/scripts/pre-tool-guard.js +55 -52
  117. package/hooks/scripts/prompt-dispatcher.js +10 -0
  118. package/hooks/scripts/scope-guard.js +40 -39
  119. package/hooks/scripts/sentinel-guard.js +41 -41
  120. package/hooks/scripts/session-start.js +13 -1
  121. package/hooks/scripts/step-counter.js +100 -7
  122. package/hooks/scripts/stop-dispatcher.js +26 -0
  123. package/hooks/scripts/utils.js +63 -21
  124. package/hooks/scripts/verify-ledger.js +22 -0
  125. package/package.json +2 -2
  126. package/skills/spec/references/templates.md +11 -6
  127. package/skills/vibe/SKILL.md +40 -23
  128. package/skills/vibe.loop/SKILL.md +116 -0
  129. package/skills/vibe.run/SKILL.md +153 -1686
  130. package/skills/vibe.run/references/brand-assets.md +59 -0
  131. package/skills/vibe.run/references/parallel-agents.md +326 -0
  132. package/skills/vibe.run/references/race-review.md +272 -0
  133. package/skills/vibe.run/references/ralph-loop.md +173 -0
  134. package/skills/vibe.run/references/ultrawork-mode.md +151 -0
  135. package/skills/vibe.trace/SKILL.md +25 -38
  136. package/skills/vibe.verify/SKILL.md +15 -0
  137. package/vibe/rules/loop-contract.md +54 -0
  138. package/vibe/templates/loop-template.md +69 -0
  139. package/hooks/scripts/figma-guard.js +0 -219
@@ -0,0 +1,173 @@
1
+ # Ralph Loop — Coverage Verification Reference
2
+
3
+ > Loaded by vibe.run SKILL.md for RTM/coverage verification. **루프 시맨틱(ANCHOR/ACT/JUDGE/RECORD/stuck/max_iterations)의 SSOT는 `vibe/rules/loop-contract.md`다.** 이 파일은 vibe.run-specific한 RTM 기반 커버리지 검증 메커니즘을 문서화한다.
4
+ >
5
+ > `ralph`는 loop-contract의 deprecated 별칭으로, "exit: coverage-100"이 설정된 기본 루프와 동일하다. 더 이상 별도 모드가 아니다.
6
+
7
+ ## Coverage Verification Loop
8
+
9
+ > **Inspired by [ghuntley.com/ralph](https://ghuntley.com/ralph)**: "Deterministically bad in an undeterministic world" — Keep iterating until TRULY complete.
10
+
11
+ **Problem**: AI often claims "complete" when implementation is partial.
12
+
13
+ **Solution**: RTM-based automated coverage verification — loop-contract의 JUDGE 기준은 `coveragePercent === 100`.
14
+
15
+ ```
16
+ ┌─────────────────────────────────────────────────────────────────┐
17
+ │ COVERAGE VERIFICATION LOOP (loop-contract + RTM) │
18
+ │ │
19
+ │ After ALL phases complete: │
20
+ │ │
21
+ │ ┌──────────────────────────────────────────────────────────┐ │
22
+ │ │ RTM COVERAGE VERIFICATION [Iteration {{ITER}}/{{MAX}}] │ │
23
+ │ │ │ │
24
+ │ │ Generate RTM via core tools: │ │
25
+ │ │ → generateTraceabilityMatrix("{feature-name}") │ │
26
+ │ │ │ │
27
+ │ │ Coverage Metrics (automated): │ │
28
+ │ │ □ Requirements coverage: {coveragePercent}% │ │
29
+ │ │ □ SPEC → Feature mapping: {featureCovered}/{total} │ │
30
+ │ │ □ Feature → Test mapping: {testCovered}/{total} │ │
31
+ │ │ □ Build successful? │ │
32
+ │ │ □ Tests passing? │ │
33
+ │ │ │ │
34
+ │ │ UNCOVERED: {uncoveredRequirements[]} │ │
35
+ │ └──────────────────────────────────────────────────────────┘ │
36
+ │ │ │
37
+ │ ┌──────────┴──────────┐ │
38
+ │ │ Coverage == 100%? │ │
39
+ │ └──────────┬──────────┘ │
40
+ │ │ │ │
41
+ │ NO YES │
42
+ │ │ │ │
43
+ │ ↓ ↓ │
44
+ │ ┌────────────────┐ ┌────────────────┐ │
45
+ │ │ IMPLEMENT │ │ TRULY DONE │ │
46
+ │ │ UNCOVERED │ │ │ │
47
+ │ │ REQUIREMENTS │ │ Report final │ │
48
+ │ │ (auto-extract) │ │ RTM coverage │ │
49
+ │ └───────┬────────┘ └────────────────┘ │
50
+ │ │ │
51
+ │ └──────────→ [Re-generate RTM] │
52
+ │ │
53
+ │ │ │
54
+ │ ↓ │
55
+ │ stuck? (loop-ledger.js check-stuck: 연속 2회 동일 커버리지) │
56
+ │ │ │
57
+ │ ├─ automationLevel confirm: Ask user │
58
+ │ │ 1. Provide resolution → retry │
59
+ │ │ 2. "proceed" → TODO + done │
60
+ │ │ 3. "abort" → stop │
61
+ │ └─ automationLevel autonomous: TODO + done │
62
+ │ │
63
+ │ max_iterations 기본 10 — 도달 시 잔여 인박스 이월 │
64
+ │ ZERO TOLERANCE for silent scope reduction │
65
+ └─────────────────────────────────────────────────────────────────┘
66
+ ```
67
+
68
+ ## RTM Invocation
69
+
70
+ ```bash
71
+ # Generate RTM for coverage verification (generateTraceabilityMatrix is synchronous — no .then())
72
+ node -e "import('{{VIBE_PATH_URL}}/node_modules/@su-record/vibe/dist/tools/index.js').then(t => { const r = t.generateTraceabilityMatrix('{feature-name}', {projectPath: process.cwd()}); console.log(JSON.stringify(r, null, 2)); })"
73
+ ```
74
+
75
+ > **Note:** Default SPEC path is `.vibe/specs/<feature>.md` (falls back to `.claude/vibe/specs/` then `.claude/specs/` for legacy projects).
76
+ > `status === 'empty'` means the gate MUST be treated as failed/not-applicable, never as 100% pass.
77
+
78
+ ## RTM Metrics
79
+
80
+ | Metric | Description |
81
+ |--------|-------------|
82
+ | `totalRequirements` | Total REQ-* items in SPEC |
83
+ | `specCovered` | Requirements with SPEC mapping |
84
+ | `featureCovered` | Requirements with Feature scenarios |
85
+ | `testCovered` | Requirements with test files |
86
+ | `coveragePercent` | Overall coverage percentage |
87
+ | `uncoveredRequirements` | List of missing REQ-* IDs |
88
+
89
+ ## Coverage Loop Rules
90
+
91
+ | Rule | Description |
92
+ |------|-------------|
93
+ | **No Scope Reduction** | Never say "simplified" or "basic version" — implement FULL request |
94
+ | **Iteration Tracking** | Display `[{{ITER}}]` to show progress; max_iterations 기본 10 |
95
+ | **RTM-Based Gap List** | Use `uncoveredRequirements` array — no manual comparison |
96
+ | **Coverage Threshold** | JUDGE: `coveragePercent === 100` → exit (loop-contract exit=coverage-100) |
97
+ | **Stuck Handling** | `loop-ledger.js check-stuck`: 연속 2회 동일 커버리지 → confirm이면 질문; autonomous이면 TODO + done |
98
+ | **Diminishing Returns** | Iteration 3+ → focus on core requirements (REQ-*-001~003) first; P2/P3 continue but lower priority |
99
+
100
+ ## Ralph Loop Output Format
101
+
102
+ ```
103
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
104
+ RALPH VERIFICATION [Iteration 1]
105
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
106
+
107
+ RTM Coverage Report: login
108
+
109
+ Requirements Traceability:
110
+ Total Requirements: 9
111
+ SPEC Covered: 9/9 (100%)
112
+ Feature Covered: 5/9 (55%)
113
+ Test Covered: 4/9 (44%)
114
+
115
+ REQ-login-001: Login form UI → Scenario 1 → login.test.ts
116
+ REQ-login-002: Email validation → Scenario 2 → validation.test.ts
117
+ REQ-login-003: Password validation → Scenario 2 → validation.test.ts
118
+ REQ-login-004: Remember me checkbox → NOT IMPLEMENTED
119
+ REQ-login-005: Forgot password link → NOT IMPLEMENTED
120
+ REQ-login-006: API integration → Scenario 3 → api.test.ts
121
+ REQ-login-007: Loading state → NOT IMPLEMENTED
122
+ REQ-login-008: Error toast → NOT IMPLEMENTED
123
+ REQ-login-009: Session storage → Scenario 4 → (no test)
124
+
125
+ Overall Coverage: 55% BELOW 100% TARGET
126
+
127
+ UNCOVERED REQUIREMENTS (auto-extracted from RTM):
128
+ 1. REQ-login-004: Remember me checkbox
129
+ 2. REQ-login-005: Forgot password link
130
+ 3. REQ-login-007: Loading state
131
+ 4. REQ-login-008: Error toast notifications
132
+
133
+ NOT COMPLETE — Implementing uncovered requirements...
134
+
135
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
136
+ RALPH VERIFICATION [Iteration 2]
137
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
138
+
139
+ RTM Coverage Report: login
140
+
141
+ Requirements Traceability:
142
+ Total Requirements: 9
143
+ SPEC Covered: 9/9 (100%)
144
+ Feature Covered: 9/9 (100%)
145
+ Test Covered: 9/9 (100%)
146
+
147
+ Overall Coverage: 100% TARGET REACHED
148
+
149
+ Build: Passed
150
+ Tests: 12/12 Passed
151
+ Type Check: No errors
152
+
153
+ RALPH VERIFIED COMPLETE!
154
+
155
+ RTM saved: .vibe/rtm/login-rtm.md
156
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
157
+ ```
158
+
159
+ ## When to Trigger Coverage Loop
160
+
161
+ 1. After all phases complete (기본 동작 — 별도 키워드 불필요)
162
+ 2. Before final quality report
163
+ 3. `ralph` 별칭 감지 시 — 기본 동작과 동일, exit=coverage-100으로 해석
164
+
165
+ ## Forbidden Responses (VIOLATIONS)
166
+
167
+ | NEVER Say | Instead |
168
+ |-----------|---------|
169
+ | "I've implemented a basic version" | Implement the FULL version |
170
+ | "This is a simplified approach" | Implement as specified |
171
+ | "You can add X later" | Add X now |
172
+ | "For demonstration purposes" | Implement production-ready |
173
+ | "The core functionality is done" | ALL functionality must be done |
@@ -0,0 +1,151 @@
1
+ # ULTRAWORK Mode — Automation Level Reference
2
+
3
+ > Loaded by vibe.run SKILL.md when user includes `ultrawork` or `ulw` keyword.
4
+ >
5
+ > **루프 시맨틱(ANCHOR/ACT/JUDGE/RECORD/stuck/max_iterations)의 SSOT는 `vibe/rules/loop-contract.md`다.** `ultrawork`/`ulw`는 `automationLevel: autonomous` + 병렬 ACT의 deprecated 별칭이다. 루프 자체는 모든 실행의 기본 동작이며, ultrawork는 그 루프를 자율(비대화형)·병렬 모드로 돌리는 축을 제어한다.
6
+
7
+ ## What `automationLevel: autonomous` Enables
8
+
9
+ `ultrawork` (또는 `ulw`, `.vibe/config.json`의 `automationLevel: autonomous`) 설정 시 활성화:
10
+
11
+ | Feature | Description |
12
+ |---------|-------------|
13
+ | **Parallel Exploration** | 3+ Task(haiku) agents run simultaneously (ACT 병렬화) |
14
+ | **Loop (기본 동작)** | 모든 실행의 기본 — exit=게이트 통과 또는 stuck 또는 max_iterations |
15
+ | **Context Compression** | Aggressive auto-save at 70%+ context |
16
+ | **No Pause** | stuck·SPEC 게이트 외 확인 없음 (`automationLevel: autonomous`) |
17
+ | **External LLMs** | Auto-consults GPT/Antigravity if enabled |
18
+ | **Error Recovery** | stuck 시 TODO 기록 후 다음으로 (사용자 질문 없음) |
19
+ | **Race Review** | Multi-LLM review (GPT+Antigravity) with cross-validation |
20
+
21
+ ## Boulder Loop — Parallel ACT Visualization
22
+
23
+ 루프 자체는 loop-contract의 기본 동작이다. Boulder Loop는 `automationLevel: autonomous`에서 **병렬 ACT**가 어떻게 실행되는지를 보여주는 다이어그램이다:
24
+
25
+ ```
26
+ ┌─────────────────────────────────────────────────────────────────┐
27
+ │ BOULDER LOOP (ultrawork) │
28
+ │ │
29
+ │ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
30
+ │ │ Phase 1 │───→│ Phase 2 │───→│ Phase 3 │───→│ Phase N │ │
31
+ │ └──────────┘ └──────────┘ └──────────┘ └──────────┘ │
32
+ │ │ │ │ │ │
33
+ │ ↓ ↓ ↓ ↓ │
34
+ │ [Parallel] [Parallel] [Parallel] [Parallel] │
35
+ │ [Implement] [Implement] [Implement] [Implement] │
36
+ │ [Test] [Test] [Test] [Test] │
37
+ │ │ │ │ │ │
38
+ │ └───────────────┴───────────────┴───────────────┘ │
39
+ │ │ │
40
+ │ ↓ │
41
+ │ ┌──────────────┐ │
42
+ │ │ ALL DONE? │ │
43
+ │ └──────────────┘ │
44
+ │ │ │ │
45
+ │ NO YES │
46
+ │ │ │ │
47
+ │ ↓ ↓ │
48
+ │ [Continue] [Complete!] │
49
+ │ │
50
+ │ loop-contract EXIT: 게이트 통과 │ stuck │ max_iterations │
51
+ └─────────────────────────────────────────────────────────────────┘
52
+ ```
53
+
54
+ ## Example Session (automationLevel: autonomous)
55
+
56
+ ```
57
+ User: /vibe.run "brick-game" ultrawork
58
+
59
+ Claude:
60
+ AUTONOMOUS MODE (automationLevel: autonomous)
61
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
62
+
63
+ SPEC: .vibe/specs/brick-game.md
64
+ 4 Phases detected
65
+ Loop: ENABLED (exit = 게이트 통과 | stuck | max_iterations=10)
66
+ Parallel ACT: ON
67
+ automationLevel: autonomous (stuck → auto-TODO, no confirmation)
68
+ Context compression: AGGRESSIVE
69
+
70
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
71
+ BOULDER ROLLING... Phase 1/4
72
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
73
+
74
+ [PARALLEL] Launching 3 exploration agents...
75
+ Exploration complete (7.2s)
76
+ Implementing...
77
+ Phase 1 complete
78
+
79
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
80
+ BOULDER ROLLING... Phase 2/4
81
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
82
+
83
+ [PARALLEL] Launching 3 exploration agents...
84
+ Exploration complete (6.8s)
85
+ Implementing...
86
+ Test failed: collision detection
87
+ Auto-retry [iteration 1]...
88
+ Fixing...
89
+ Phase 2 complete
90
+
91
+ [...continues automatically...]
92
+
93
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
94
+ BOULDER REACHED THE TOP!
95
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
96
+
97
+ All 4 phases complete
98
+ All acceptance criteria passed
99
+ Build succeeded
100
+ Tests passed
101
+
102
+ Total: 8m 24s
103
+ Retries: 2
104
+ Context saved: 3 checkpoints
105
+ ```
106
+
107
+ ## confirm vs autonomous Comparison
108
+
109
+ | Aspect | `automationLevel: confirm` (default) | `automationLevel: autonomous` (ultrawork) |
110
+ |--------|--------------------------------------|-------------------------------------------|
111
+ | Loop | ANCHOR→ACT→JUDGE→RECORD (기본 동작) | 동일 |
112
+ | Confirmation gates | stuck·SPEC에서 질문 | stuck 포함 전부 skip → TODO |
113
+ | On error | Reports, asks before retry | Auto-retries, auto-TODO on stuck |
114
+ | Context 70%+ | Warning only | Auto-compress + save |
115
+ | Exploration | Sequential possible | FORCED parallel |
116
+
117
+ ## Automation Level System
118
+
119
+ **automationLevel**은 루프가 사람 개입 없이 얼마나 자율적으로 진행하는지를 제어한다. `.vibe/config.json`에서 설정하거나, deprecated 별칭 키워드로 런타임 오버라이드 가능.
120
+
121
+ ### Level Definitions
122
+
123
+ | Level | Name | 설정 방법 | Auto-advance | Auto-retry | Stuck Behavior | Parallel Agents | Checkpoints |
124
+ |-------|------|-----------|--------------|------------|----------------|-----------------|-------------|
125
+ | L0 | Manual | `manual` | No | No | Ask user every step | No | All |
126
+ | L1 | Guided | `guided`, `verify`(deprecated) | No | No | Ask user on stuck | No | All |
127
+ | L2 | confirm | default | Yes | Yes (low cap: 2) | Ask user after 2 retries | No | Key points |
128
+ | L3 | autonomous | `automationLevel: autonomous` / `ultrawork`(dep) / `ulw`(dep) | Yes | Yes (no cap) | Auto-TODO + proceed | Yes | Checkpoint-only |
129
+ | L4 | Full-auto | `ralph`(deprecated) / `ralplan`(deprecated) | Yes | Yes (no cap) | Auto-TODO + proceed | Yes | None |
130
+
131
+ ### Detection Rule (deprecated aliases)
132
+
133
+ ```
134
+ /vibe.run "login" → L2 confirm (default)
135
+ /vibe.run "login" ultrawork → L3 autonomous (deprecated alias)
136
+ /vibe.run "login" ralph → L4 Full-auto (deprecated alias, exit=coverage-100)
137
+ /vibe.run "login" verify → L1 Guided (deprecated alias)
138
+ ```
139
+
140
+ ### Confirmation Matrix
141
+
142
+ | Action | L0 | L1 | L2 | L3 | L4 |
143
+ |--------|----|----|----|----|-----|
144
+ | `destructive` | confirm | confirm | confirm | confirm | auto |
145
+ | `architecture_choice` | confirm | confirm | confirm | auto | auto |
146
+ | `implementation_scope` | confirm | confirm | confirm | auto | auto |
147
+ | `phase_advance` | confirm | confirm | auto | auto | auto |
148
+ | `fix_strategy` | confirm | confirm | auto | auto | auto |
149
+ | `retry` | confirm | auto | auto | auto | auto |
150
+
151
+ **Rule**: When confirmation is required, pause and display a checkpoint before proceeding.
@@ -187,63 +187,50 @@ Loading files:
187
187
  The RTM generation uses core tools:
188
188
 
189
189
  ```bash
190
- # Generate RTM
191
- node -e "import('{{VIBE_PATH_URL}}/node_modules/@su-record/vibe/dist/tools/index.js').then(t => t.generateTraceabilityMatrix('login').then(m => console.log(t.formatMatrixAsMarkdown(m))))"
190
+ # Generate RTM (generateTraceabilityMatrix is synchronous — no .then())
191
+ node -e "import('{{VIBE_PATH_URL}}/node_modules/@su-record/vibe/dist/tools/index.js').then(t => { const m = t.generateTraceabilityMatrix('login', {projectPath: process.cwd()}); console.log(t.formatMatrixAsMarkdown(m)); })"
192
192
 
193
193
  # Generate HTML
194
- node -e "import('{{VIBE_PATH_URL}}/node_modules/@su-record/vibe/dist/tools/index.js').then(t => t.generateTraceabilityMatrix('login').then(m => console.log(t.formatMatrixAsHtml(m))))"
194
+ node -e "import('{{VIBE_PATH_URL}}/node_modules/@su-record/vibe/dist/tools/index.js').then(t => { const m = t.generateTraceabilityMatrix('login', {projectPath: process.cwd()}); console.log(t.formatMatrixAsHtml(m)); })"
195
195
  ```
196
196
 
197
- ## VerificationLoop Integration
197
+ > **Note:** Default SPEC path is `.vibe/specs/<feature>.md` (falls back to `.claude/vibe/specs/` then `.claude/specs/` for legacy projects).
198
+ > `status === 'empty'` means the gate MUST be treated as failed/not-applicable, never as 100% pass.
198
199
 
199
- `/vibe.trace` results feed directly into the **VerificationLoop** module, which quantifies achievement rate and drives automatic re-iteration.
200
+ ## Post-Trace Gates
200
201
 
201
- ### Key Functions
202
+ After `/vibe.trace` completes and the RTM is displayed, two downstream mechanisms consume the result.
202
203
 
203
- | Function | Purpose |
204
- |----------|---------|
205
- | `createLoop(feature, config?)` | Initialize a new verification loop for a feature |
206
- | `recordVerification(state, requirements)` | Record RTM results and determine next action |
207
- | `formatVerificationResult(result, config)` | Format a single iteration result for display |
208
- | `formatLoopSummary(state)` | Format the full loop history as readable text |
209
- | `getUnmetRequirements(result)` | Extract failed/partial requirements for targeted fixing |
210
- | `isImproving(state)` | Detect whether achievement rate is increasing across iterations |
204
+ ### Empty-result gate
211
205
 
212
- ### Loop Configuration
206
+ `generateTraceabilityMatrix` returns `status: 'empty'` when no `REQ-<feature>-NNN` IDs are found in the SPEC. This state **must be treated as a gate failure**, not as 100% coverage. When the matrix status is `empty`, report it explicitly and do not proceed as if the feature is verified.
213
207
 
214
208
  ```
215
- threshold: 90 — Minimum achievement rate (%) to pass (default)
216
- maxIterations: 3 — Max re-verification attempts before stopping
217
- autoRetry: false Whether to auto-trigger re-implementation
209
+ RTM status === 'empty'
210
+ Coverage gate: FAILED (no requirements to trace)
211
+ → Action: run /vibe.spec to add REQ-IDs before re-running /vibe.trace
218
212
  ```
219
213
 
220
- ### Action Types
214
+ ### Run-ledger flow
221
215
 
222
- After each `recordVerification` call, the loop returns one of:
216
+ `/vibe.verify` records its outcome via `hooks/scripts/verify-ledger.js pass|fail`. This writes `verifyPassed` and `verifyAt` into `.vibe/metrics/run-ledger.json`. Downstream gates consume this record:
223
217
 
224
- | Action | Condition | Meaning |
225
- |--------|-----------|---------|
226
- | `passed` | rate >= threshold | All requirements met done |
227
- | `retry` | rate < threshold AND iterations remaining | Fix unmet requirements and re-run |
228
- | `max_iterations` | rate < threshold AND no iterations left | Report remaining gaps as TODO |
218
+ | Gate | Behavior |
219
+ |------|----------|
220
+ | `auto-commit` | Commits only when `verifyPassed === true` AND `verifyAt > runStarted` |
221
+ | Stop hook | Warns when `runStarted && !verifyPassed`; blocks once if `verifyGate.mode === 'block'` |
229
222
 
230
- ### Convergence Detection
231
-
232
- If the achievement rate does not improve between iterations (`isImproving` returns false), the loop stops early to avoid wasted cycles.
233
-
234
- ### Example Flow
223
+ **To register a passing trace as verified**, run `/vibe.verify` after `/vibe.trace` reports acceptable coverage. The verify skill calls `verify-ledger.js pass` internally — you do not invoke it manually.
235
224
 
236
225
  ```
237
- /vibe.trace "login"
238
- RTM generated: 7/9 requirements covered (78%)
239
- createLoop("login", { threshold: 90, maxIterations: 3 })
240
- recordVerification(...)action: retry (iteration 1, 3 unmet)
241
- → [fix unmet requirements]
242
- → /vibe.trace "login"
243
- → recordVerification(...) → action: passed (rate: 100%)
244
- → formatVerificationResult → display final report
226
+ /vibe.trace "login" → RTM: 9/9 (100%)
227
+ /vibe.verify "login" runs checks calls verify-ledger.js pass
228
+ .vibe/metrics/run-ledger.json updated
229
+ auto-commit / Stop gate verifyPassed=true, gate clears
245
230
  ```
246
231
 
232
+ If `/vibe.verify` is skipped, `auto-commit` will log the skip reason and abort the commit.
233
+
247
234
  ## Options
248
235
 
249
236
  | Option | Description |
@@ -465,6 +465,21 @@ Load skill `contract` with: check "{feature-name}"
465
465
  - **P1 drift** → demote verify to fail; auto-call `/vibe.regress register --from-contract`
466
466
  - P2 / P3 drift → warning only; verify still passes
467
467
 
468
+ ## Ledger Update (MANDATORY final step)
469
+
470
+ After producing the verification report, record the result to the run ledger:
471
+
472
+ ```bash
473
+ # pass 또는 fail — 시나리오 전체 통과 여부에 따라 선택
474
+ HOOKS_DIR="${VIBE_PATH:-$(npm root -g 2>/dev/null)/@su-record/vibe}/hooks/scripts"
475
+ if [ -f "$HOOKS_DIR/verify-ledger.js" ]; then
476
+ node "$HOOKS_DIR/verify-ledger.js" pass # 전체 통과 시
477
+ # node "$HOOKS_DIR/verify-ledger.js" fail # 실패 시
478
+ fi
479
+ ```
480
+
481
+ Replace `pass` with `fail` when any scenario fails. This step enables the Stop-hook verify-skip gate and auto-commit verify gate.
482
+
468
483
  ## Next Step
469
484
 
470
485
  On verification pass:
@@ -0,0 +1,54 @@
1
+ # Loop Contract — vibe 실행의 기본 계약 (SSOT)
2
+
3
+ > `/vibe`의 기본 동작은 **단계별 1회 실행이 아니라 완성까지의 루프**다.
4
+ > 루프가 기본이 될 수 있는 이유: 폭주 방어가 모델의 양심이 아니라 결정론적 가드(코드)이기 때문.
5
+ > 이 문서가 루프 시맨틱의 유일한 정의다 — ralph/Boulder/Convergence 등 과거 명칭은 전부 이 계약의 파라미터로 환원된다.
6
+
7
+ ## 적용 범위
8
+
9
+ - **적용**: 검증 가능한 목표가 있는 실행 — `vibe.run`, `vibe.verify`, `vibe.review`, `vibe.loop` 및 이들을 체인하는 `/vibe` 파이프라인
10
+ - **제외**: 단발 조회·생성 작업 (`vibe.docs`, `vibe.analyze`, `vibe.scaffold` 등) — 루프 의례를 강제하지 않는다
11
+
12
+ ## 계약
13
+
14
+ ```
15
+ /vibe {요구사항}
16
+ → SPEC 확정 ← 유일한 의무적 사람 개입 지점 (DONE의 정의 = REQ-ID + 수용 기준 승인)
17
+ → 루프:
18
+ ANCHOR 디스크에서 재고정: SPEC + run-ledger + scope.json (+ 직전 인박스)
19
+ ACT 파이프라인 실행 (스킬 체인)
20
+ JUDGE 결정론 판정만 인정: run-ledger verifyPassed │ 테스트 exit code │ RTM status
21
+ — 모델의 "완료했습니다" 자기 보고는 종료 조건이 될 수 없다
22
+ RECORD run-ledger(현재 회전) + loop-history.jsonl(회전 이력, 스케줄 루프)
23
+ → 종료(EXIT): 게이트 전부 통과 │ stuck │ max_iterations │ 예산 상한
24
+ ```
25
+
26
+ ### ANCHOR가 컨텍스트 오염 방어인 이유
27
+ 루프 상태는 컨텍스트가 아니라 디스크에 산다. 매 회전이 아티팩트에서 다시 시작하므로 컨텍스트가 오염되거나 compact로 소실돼도 루프는 깨지지 않으며, 회전마다 fresh 컨텍스트(서브에이전트)로 돌려도 된다.
28
+
29
+ ### stuck (결정론)
30
+ 연속 2회 회전의 발견(discover/findings) 해시가 동일 → 중단하고 사람에게 (`loop-ledger.js check-stuck`이 판정·기록). "다시 해보면 될 것 같다"는 모델 판단으로 무시 금지.
31
+
32
+ ## 파라미터 (기본값)
33
+
34
+ | 파라미터 | 기본 | 의미 |
35
+ |---|---|---|
36
+ | `max_iterations` | 10 | 회전 상한. 도달 시 잔여를 인박스로 이월 |
37
+ | `exit` | 게이트 통과 (P1=0 ∧ verifyPassed) | 종료 기준. coverage 100% 등으로 상향 가능 |
38
+ | `--interactive` | off | 단계별 확인 모드 (회전마다 사람 승인 — 과거의 기본값) |
39
+ | `--max-iter N` | — | 회전 상한 명시 (N=1이면 1회 시도) |
40
+ | `automationLevel` | `confirm` | `confirm`(SPEC·stuck에서 질문) / `autonomous`(기록 후 계속, 비대화형) — `.vibe/config.json` |
41
+
42
+ ## 금지 (루프 권한 경계)
43
+
44
+ 루프는 push·release·배포·버전 범프를 수행하지 않는다. 커밋은 auto-commit verify 게이트 통과 시만. 결과는 인박스(사람 리뷰 큐)로.
45
+
46
+ ## Deprecated 별칭 (하위 호환 매핑 — 새 문서에서 가르치지 않는다)
47
+
48
+ | 별칭 | 환원 |
49
+ |---|---|
50
+ | `ralph` | 기본 동작과 동일 (no-op). 굳이 구분하면 `exit: coverage-100` |
51
+ | `verify` | 기본 동작과 동일 (no-op) — JUDGE는 항상 결정론 검증 |
52
+ | `quick` | `--max-iter 1` + 최소 JUDGE |
53
+ | `ralplan` | 같은 계약을 계획 단계에 적용 |
54
+ | `ultrawork` / `ulw` | `automationLevel: autonomous` + 병렬 ACT — 루프 시맨틱이 아니라 자율성·병렬성 축 |
@@ -0,0 +1,69 @@
1
+ ---
2
+ name: {loop-name}
3
+ trigger: scheduled
4
+ schedule: "0 2 * * *"
5
+ goal: "{사람이 읽는 루프 목표 — 한 문장}"
6
+ discover: |
7
+ {일거리를 발견하는 지시문.
8
+ 여러 줄 사용 가능.
9
+ 예: .vibe/regressions/open/*.md 를 스캔해 우선순위 높은 항목을 반환한다.}
10
+ pipeline:
11
+ - vibe.spec
12
+ - vibe.run
13
+ - vibe.verify
14
+ verify: ledger
15
+ max_iterations: 10
16
+ isolation: none
17
+ status: active
18
+ ---
19
+
20
+ # 루프: {loop-name}
21
+
22
+ ## 목적
23
+
24
+ {이 루프가 자동화하는 작업과 그 이유를 1–3문장으로 설명한다.}
25
+
26
+ ## Discover 상세
27
+
28
+ {`discover` frontmatter 필드의 상세 설명.
29
+ 루프 런타임이 어떤 소스를 보는지, 어떤 형식으로 항목이 반환되는지 기술한다.
30
+
31
+ 예시:
32
+ - 스캔 대상: `.vibe/regressions/open/`
33
+ - 반환 형식: `- REQ-XXX-NNN: 설명` 불릿 목록
34
+ - 빈 결과 처리: 항목 없을 시 루프 즉시 종료}
35
+
36
+ ## 항목별 파이프라인
37
+
38
+ {`pipeline` frontmatter에 나열된 각 스킬이 단일 항목에 대해 수행하는 작업을 설명한다.
39
+
40
+ | 단계 | 스킬 | 입력 | 출력 |
41
+ |------|------|------|------|
42
+ | 1 | vibe.spec | 항목 설명 | SPEC 파일 |
43
+ | 2 | vibe.run | SPEC | 구현 |
44
+ | 3 | vibe.verify | 구현 | 검증 결과 |
45
+ }
46
+
47
+ ## 종료 조건
48
+
49
+ {루프가 단일 항목 처리를 완료로 판정하는 조건을 명시한다.}
50
+
51
+ - `verify: ledger` — `.vibe/metrics/run-ledger.json`의 `verifyPassed === true` (모델 자기 보고 불가)
52
+ - `verify: tests` — `test_command` exit code 0
53
+ - `verify: none` — 파이프라인 마지막 스킬 완료 시
54
+ - 연속 2회 `discoverHash` 동일 → stuck으로 중단, 인박스 기록
55
+
56
+ ## 인박스 보고 형식
57
+
58
+ {각 반복 완료 후 `.vibe/loops/inbox.md`에 추가되는 항목 형식.}
59
+
60
+ ```
61
+ ## [{loop-name}] {YYYY-MM-DD HH:mm}
62
+
63
+ - **결과**: ok | fail | stuck
64
+ - **처리한 항목**: {항목 설명}
65
+ - **검증 상태**: verifyPassed=true | false
66
+ - **리뷰 필요**: {사람이 확인해야 할 사항. 없으면 "없음"}
67
+ ```
68
+
69
+ > 루프는 push·release·배포를 수행하지 않는다. auto-commit verify 게이트 통과 시 커밋까지만.