@boshu2/vibe-check 1.8.0 → 2.0.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/.claude/settings.local.json +1 -1
- package/CHANGELOG.md +10 -0
- package/CLAUDE.md +58 -0
- package/Makefile +43 -6
- package/README.md +80 -27
- package/bin/vibe-check.js +1 -1
- package/claude-progress.json +18 -0
- package/dist/analysis/cross-session-analysis.d.ts +1 -1
- package/dist/analysis/cross-session-analysis.d.ts.map +1 -1
- package/dist/analysis/cross-session-analysis.js +9 -18
- package/dist/analysis/cross-session-analysis.js.map +1 -1
- package/dist/analysis/index.d.ts +1 -1
- package/dist/analysis/index.d.ts.map +1 -1
- package/dist/analysis/index.js +1 -11
- package/dist/analysis/index.js.map +1 -1
- package/dist/analyzers/audit.d.ts +28 -0
- package/dist/analyzers/audit.d.ts.map +1 -0
- package/dist/analyzers/audit.js +86 -0
- package/dist/analyzers/audit.js.map +1 -0
- package/dist/analyzers/patterns.d.ts +1 -1
- package/dist/analyzers/patterns.d.ts.map +1 -1
- package/dist/analyzers/patterns.js +4 -10
- package/dist/analyzers/patterns.js.map +1 -1
- package/dist/analyzers/quality.d.ts +1 -1
- package/dist/analyzers/quality.d.ts.map +1 -1
- package/dist/analyzers/quality.js +5 -12
- package/dist/analyzers/quality.js.map +1 -1
- package/dist/analyzers/sessions.d.ts +1 -1
- package/dist/analyzers/sessions.d.ts.map +1 -1
- package/dist/analyzers/sessions.js +1 -4
- package/dist/analyzers/sessions.js.map +1 -1
- package/dist/cli.js +20 -20
- package/dist/cli.js.map +1 -1
- package/dist/commands/analyze.d.ts.map +1 -1
- package/dist/commands/analyze.js +114 -149
- package/dist/commands/analyze.js.map +1 -1
- package/dist/commands/audit.d.ts +3 -0
- package/dist/commands/audit.d.ts.map +1 -0
- package/dist/commands/audit.js +77 -0
- package/dist/commands/audit.js.map +1 -0
- package/dist/commands/cache.js +31 -70
- package/dist/commands/cache.js.map +1 -1
- package/dist/commands/dashboard.d.ts.map +1 -1
- package/dist/commands/dashboard.js +22 -58
- package/dist/commands/dashboard.js.map +1 -1
- package/dist/commands/forensics.d.ts +2 -2
- package/dist/commands/forensics.d.ts.map +1 -1
- package/dist/commands/forensics.js +41 -48
- package/dist/commands/forensics.js.map +1 -1
- package/dist/commands/index.d.ts +14 -13
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/commands/index.js +14 -33
- package/dist/commands/index.js.map +1 -1
- package/dist/commands/init-hook.js +26 -32
- package/dist/commands/init-hook.js.map +1 -1
- package/dist/commands/insights.js +39 -45
- package/dist/commands/insights.js.map +1 -1
- package/dist/commands/pipeline.js +39 -78
- package/dist/commands/pipeline.js.map +1 -1
- package/dist/commands/profile.js +68 -74
- package/dist/commands/profile.js.map +1 -1
- package/dist/commands/session.d.ts +9 -0
- package/dist/commands/session.d.ts.map +1 -1
- package/dist/commands/session.js +134 -118
- package/dist/commands/session.js.map +1 -1
- package/dist/commands/sessions.d.ts +1 -1
- package/dist/commands/sessions.d.ts.map +1 -1
- package/dist/commands/sessions.js +42 -49
- package/dist/commands/sessions.js.map +1 -1
- package/dist/commands/start.js +22 -67
- package/dist/commands/start.js.map +1 -1
- package/dist/commands/timeline.js +74 -81
- package/dist/commands/timeline.js.map +1 -1
- package/dist/commands/watch.d.ts.map +1 -1
- package/dist/commands/watch.js +117 -47
- package/dist/commands/watch.js.map +1 -1
- package/dist/gamification/achievements.d.ts +1 -1
- package/dist/gamification/achievements.d.ts.map +1 -1
- package/dist/gamification/achievements.js +7 -13
- package/dist/gamification/achievements.js.map +1 -1
- package/dist/gamification/index.d.ts +8 -8
- package/dist/gamification/index.d.ts.map +1 -1
- package/dist/gamification/index.js +8 -28
- package/dist/gamification/index.js.map +1 -1
- package/dist/gamification/profile.d.ts +2 -2
- package/dist/gamification/profile.d.ts.map +1 -1
- package/dist/gamification/profile.js +21 -64
- package/dist/gamification/profile.js.map +1 -1
- package/dist/gamification/stats.d.ts +1 -1
- package/dist/gamification/stats.d.ts.map +1 -1
- package/dist/gamification/stats.js +4 -10
- package/dist/gamification/stats.js.map +1 -1
- package/dist/gamification/streaks.d.ts +1 -1
- package/dist/gamification/streaks.d.ts.map +1 -1
- package/dist/gamification/streaks.js +8 -18
- package/dist/gamification/streaks.js.map +1 -1
- package/dist/gamification/types.js +3 -6
- package/dist/gamification/types.js.map +1 -1
- package/dist/gamification/xp.d.ts +1 -1
- package/dist/gamification/xp.d.ts.map +1 -1
- package/dist/gamification/xp.js +29 -38
- package/dist/gamification/xp.js.map +1 -1
- package/dist/git.d.ts +1 -1
- package/dist/git.d.ts.map +1 -1
- package/dist/git.js +15 -27
- package/dist/git.js.map +1 -1
- package/dist/inner-loop/context-amnesia.d.ts +20 -0
- package/dist/inner-loop/context-amnesia.d.ts.map +1 -0
- package/dist/inner-loop/context-amnesia.js +246 -0
- package/dist/inner-loop/context-amnesia.js.map +1 -0
- package/dist/inner-loop/index.d.ts +39 -0
- package/dist/inner-loop/index.d.ts.map +1 -0
- package/dist/inner-loop/index.js +181 -0
- package/dist/inner-loop/index.js.map +1 -0
- package/dist/inner-loop/instruction-drift.d.ts +28 -0
- package/dist/inner-loop/instruction-drift.d.ts.map +1 -0
- package/dist/inner-loop/instruction-drift.js +255 -0
- package/dist/inner-loop/instruction-drift.js.map +1 -0
- package/dist/inner-loop/logging-only.d.ts +30 -0
- package/dist/inner-loop/logging-only.d.ts.map +1 -0
- package/dist/inner-loop/logging-only.js +256 -0
- package/dist/inner-loop/logging-only.js.map +1 -0
- package/dist/inner-loop/tests-passing-lie.d.ts +34 -0
- package/dist/inner-loop/tests-passing-lie.d.ts.map +1 -0
- package/dist/inner-loop/tests-passing-lie.js +208 -0
- package/dist/inner-loop/tests-passing-lie.js.map +1 -0
- package/dist/inner-loop/types.d.ts +111 -0
- package/dist/inner-loop/types.d.ts.map +1 -0
- package/dist/inner-loop/types.js +26 -0
- package/dist/inner-loop/types.js.map +1 -0
- package/dist/insights/generators.d.ts +4 -4
- package/dist/insights/generators.d.ts.map +1 -1
- package/dist/insights/generators.js +9 -20
- package/dist/insights/generators.js.map +1 -1
- package/dist/insights/index.d.ts +4 -4
- package/dist/insights/index.d.ts.map +1 -1
- package/dist/insights/index.js +23 -27
- package/dist/insights/index.js.map +1 -1
- package/dist/insights/types.js +1 -2
- package/dist/insights/types.js.map +1 -1
- package/dist/metrics/code-stability.d.ts +1 -1
- package/dist/metrics/code-stability.d.ts.map +1 -1
- package/dist/metrics/code-stability.js +1 -4
- package/dist/metrics/code-stability.js.map +1 -1
- package/dist/metrics/file-churn.d.ts +1 -1
- package/dist/metrics/file-churn.d.ts.map +1 -1
- package/dist/metrics/file-churn.js +1 -4
- package/dist/metrics/file-churn.js.map +1 -1
- package/dist/metrics/flow.d.ts +1 -1
- package/dist/metrics/flow.d.ts.map +1 -1
- package/dist/metrics/flow.js +1 -4
- package/dist/metrics/flow.js.map +1 -1
- package/dist/metrics/index.d.ts +2 -2
- package/dist/metrics/index.d.ts.map +1 -1
- package/dist/metrics/index.js +15 -20
- package/dist/metrics/index.js.map +1 -1
- package/dist/metrics/rework.d.ts +1 -1
- package/dist/metrics/rework.d.ts.map +1 -1
- package/dist/metrics/rework.js +1 -4
- package/dist/metrics/rework.js.map +1 -1
- package/dist/metrics/spirals.d.ts +1 -1
- package/dist/metrics/spirals.d.ts.map +1 -1
- package/dist/metrics/spirals.js +5 -10
- package/dist/metrics/spirals.js.map +1 -1
- package/dist/metrics/time-spiral.d.ts +1 -1
- package/dist/metrics/time-spiral.d.ts.map +1 -1
- package/dist/metrics/time-spiral.js +1 -4
- package/dist/metrics/time-spiral.js.map +1 -1
- package/dist/metrics/trust.d.ts +1 -1
- package/dist/metrics/trust.d.ts.map +1 -1
- package/dist/metrics/trust.js +3 -6
- package/dist/metrics/trust.js.map +1 -1
- package/dist/metrics/velocity-anomaly.d.ts +1 -1
- package/dist/metrics/velocity-anomaly.d.ts.map +1 -1
- package/dist/metrics/velocity-anomaly.js +3 -6
- package/dist/metrics/velocity-anomaly.js.map +1 -1
- package/dist/metrics/velocity.d.ts +1 -1
- package/dist/metrics/velocity.d.ts.map +1 -1
- package/dist/metrics/velocity.js +6 -10
- package/dist/metrics/velocity.js.map +1 -1
- package/dist/output/index.d.ts +4 -4
- package/dist/output/index.d.ts.map +1 -1
- package/dist/output/index.js +10 -18
- package/dist/output/index.js.map +1 -1
- package/dist/output/json.d.ts +1 -1
- package/dist/output/json.d.ts.map +1 -1
- package/dist/output/json.js +1 -4
- package/dist/output/json.js.map +1 -1
- package/dist/output/markdown.d.ts +1 -1
- package/dist/output/markdown.d.ts.map +1 -1
- package/dist/output/markdown.js +5 -8
- package/dist/output/markdown.js.map +1 -1
- package/dist/output/terminal.d.ts +1 -1
- package/dist/output/terminal.d.ts.map +1 -1
- package/dist/output/terminal.js +55 -62
- package/dist/output/terminal.js.map +1 -1
- package/dist/output/timeline-html.d.ts +1 -1
- package/dist/output/timeline-html.d.ts.map +1 -1
- package/dist/output/timeline-html.js +5 -8
- package/dist/output/timeline-html.js.map +1 -1
- package/dist/output/timeline-markdown.d.ts +1 -1
- package/dist/output/timeline-markdown.d.ts.map +1 -1
- package/dist/output/timeline-markdown.js +5 -8
- package/dist/output/timeline-markdown.js.map +1 -1
- package/dist/output/timeline.d.ts +1 -1
- package/dist/output/timeline.d.ts.map +1 -1
- package/dist/output/timeline.js +46 -52
- package/dist/output/timeline.js.map +1 -1
- package/dist/patterns/detour.d.ts +1 -1
- package/dist/patterns/detour.d.ts.map +1 -1
- package/dist/patterns/detour.js +1 -4
- package/dist/patterns/detour.js.map +1 -1
- package/dist/patterns/flow-state.d.ts +1 -1
- package/dist/patterns/flow-state.d.ts.map +1 -1
- package/dist/patterns/flow-state.js +1 -4
- package/dist/patterns/flow-state.js.map +1 -1
- package/dist/patterns/index.d.ts +7 -7
- package/dist/patterns/index.d.ts.map +1 -1
- package/dist/patterns/index.js +7 -21
- package/dist/patterns/index.js.map +1 -1
- package/dist/patterns/intervention-effectiveness.d.ts +1 -1
- package/dist/patterns/intervention-effectiveness.d.ts.map +1 -1
- package/dist/patterns/intervention-effectiveness.js +3 -8
- package/dist/patterns/intervention-effectiveness.js.map +1 -1
- package/dist/patterns/late-night.d.ts +1 -1
- package/dist/patterns/late-night.d.ts.map +1 -1
- package/dist/patterns/late-night.js +1 -4
- package/dist/patterns/late-night.js.map +1 -1
- package/dist/patterns/post-delete-sprint.d.ts +1 -1
- package/dist/patterns/post-delete-sprint.d.ts.map +1 -1
- package/dist/patterns/post-delete-sprint.js +1 -4
- package/dist/patterns/post-delete-sprint.js.map +1 -1
- package/dist/patterns/spiral-regression.d.ts +1 -1
- package/dist/patterns/spiral-regression.d.ts.map +1 -1
- package/dist/patterns/spiral-regression.js +3 -8
- package/dist/patterns/spiral-regression.js.map +1 -1
- package/dist/patterns/thrashing.d.ts +1 -1
- package/dist/patterns/thrashing.d.ts.map +1 -1
- package/dist/patterns/thrashing.js +3 -6
- package/dist/patterns/thrashing.js.map +1 -1
- package/dist/score/index.d.ts +3 -3
- package/dist/score/index.d.ts.map +1 -1
- package/dist/score/index.js +4 -10
- package/dist/score/index.js.map +1 -1
- package/dist/score/weights.js +2 -6
- package/dist/score/weights.js.map +1 -1
- package/dist/sessions/index.js +9 -51
- package/dist/sessions/index.js.map +1 -1
- package/dist/storage/atomic.js +10 -51
- package/dist/storage/atomic.js.map +1 -1
- package/dist/storage/commit-log.d.ts +1 -1
- package/dist/storage/commit-log.d.ts.map +1 -1
- package/dist/storage/commit-log.js +11 -51
- package/dist/storage/commit-log.js.map +1 -1
- package/dist/storage/index.d.ts +5 -5
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/storage/index.js +5 -37
- package/dist/storage/index.js.map +1 -1
- package/dist/storage/schema.js +4 -9
- package/dist/storage/schema.js.map +1 -1
- package/dist/storage/spiral-history.js +14 -57
- package/dist/storage/spiral-history.js.map +1 -1
- package/dist/storage/timeline-store.d.ts +2 -2
- package/dist/storage/timeline-store.d.ts.map +1 -1
- package/dist/storage/timeline-store.js +17 -61
- package/dist/storage/timeline-store.js.map +1 -1
- package/dist/types.js +1 -2
- package/docs/ENHANCEMENT-PLAN.md +361 -0
- package/docs/FEATURES.md +340 -0
- package/feature-list.json +6 -0
- package/package.json +8 -7
- package/dist/calibration/ece.d.ts +0 -26
- package/dist/calibration/ece.d.ts.map +0 -1
- package/dist/calibration/ece.js +0 -93
- package/dist/calibration/ece.js.map +0 -1
- package/dist/calibration/index.d.ts +0 -3
- package/dist/calibration/index.d.ts.map +0 -1
- package/dist/calibration/index.js +0 -15
- package/dist/calibration/index.js.map +0 -1
- package/dist/calibration/storage.d.ts +0 -34
- package/dist/calibration/storage.d.ts.map +0 -1
- package/dist/calibration/storage.js +0 -188
- package/dist/calibration/storage.js.map +0 -1
- package/dist/commands/intervene.d.ts +0 -15
- package/dist/commands/intervene.d.ts.map +0 -1
- package/dist/commands/intervene.js +0 -183
- package/dist/commands/intervene.js.map +0 -1
- package/dist/commands/learn.d.ts +0 -3
- package/dist/commands/learn.d.ts.map +0 -1
- package/dist/commands/learn.js +0 -161
- package/dist/commands/learn.js.map +0 -1
- package/dist/commands/lesson.d.ts +0 -8
- package/dist/commands/lesson.d.ts.map +0 -1
- package/dist/commands/lesson.js +0 -206
- package/dist/commands/lesson.js.map +0 -1
- package/dist/commands/level.d.ts +0 -3
- package/dist/commands/level.d.ts.map +0 -1
- package/dist/commands/level.js +0 -277
- package/dist/commands/level.js.map +0 -1
- package/dist/gamification/badges.d.ts +0 -29
- package/dist/gamification/badges.d.ts.map +0 -1
- package/dist/gamification/badges.js +0 -114
- package/dist/gamification/badges.js.map +0 -1
- package/dist/gamification/challenges.d.ts +0 -42
- package/dist/gamification/challenges.d.ts.map +0 -1
- package/dist/gamification/challenges.js +0 -184
- package/dist/gamification/challenges.js.map +0 -1
- package/dist/gamification/hall-of-fame.d.ts +0 -17
- package/dist/gamification/hall-of-fame.d.ts.map +0 -1
- package/dist/gamification/hall-of-fame.js +0 -64
- package/dist/gamification/hall-of-fame.js.map +0 -1
- package/dist/gamification/intervention-memory.d.ts +0 -61
- package/dist/gamification/intervention-memory.d.ts.map +0 -1
- package/dist/gamification/intervention-memory.js +0 -229
- package/dist/gamification/intervention-memory.js.map +0 -1
- package/dist/gamification/leaderboards.d.ts +0 -49
- package/dist/gamification/leaderboards.d.ts.map +0 -1
- package/dist/gamification/leaderboards.js +0 -179
- package/dist/gamification/leaderboards.js.map +0 -1
- package/dist/gamification/pattern-memory.d.ts +0 -45
- package/dist/gamification/pattern-memory.d.ts.map +0 -1
- package/dist/gamification/pattern-memory.js +0 -188
- package/dist/gamification/pattern-memory.js.map +0 -1
- package/dist/gamification/share.d.ts +0 -29
- package/dist/gamification/share.d.ts.map +0 -1
- package/dist/gamification/share.js +0 -57
- package/dist/gamification/share.js.map +0 -1
- package/dist/learning/cadence.d.ts +0 -15
- package/dist/learning/cadence.d.ts.map +0 -1
- package/dist/learning/cadence.js +0 -130
- package/dist/learning/cadence.js.map +0 -1
- package/dist/learning/index.d.ts +0 -19
- package/dist/learning/index.d.ts.map +0 -1
- package/dist/learning/index.js +0 -35
- package/dist/learning/index.js.map +0 -1
- package/dist/learning/lessons-storage.d.ts +0 -48
- package/dist/learning/lessons-storage.d.ts.map +0 -1
- package/dist/learning/lessons-storage.js +0 -266
- package/dist/learning/lessons-storage.js.map +0 -1
- package/dist/learning/lessons-types.d.ts +0 -83
- package/dist/learning/lessons-types.d.ts.map +0 -1
- package/dist/learning/lessons-types.js +0 -15
- package/dist/learning/lessons-types.js.map +0 -1
- package/dist/learning/nudges.d.ts +0 -20
- package/dist/learning/nudges.d.ts.map +0 -1
- package/dist/learning/nudges.js +0 -68
- package/dist/learning/nudges.js.map +0 -1
- package/dist/learning/retrospective.d.ts +0 -27
- package/dist/learning/retrospective.d.ts.map +0 -1
- package/dist/learning/retrospective.js +0 -184
- package/dist/learning/retrospective.js.map +0 -1
- package/dist/learning/storage.d.ts +0 -44
- package/dist/learning/storage.d.ts.map +0 -1
- package/dist/learning/storage.js +0 -194
- package/dist/learning/storage.js.map +0 -1
- package/dist/learning/surfacing.d.ts +0 -36
- package/dist/learning/surfacing.d.ts.map +0 -1
- package/dist/learning/surfacing.js +0 -255
- package/dist/learning/surfacing.js.map +0 -1
- package/dist/learning/synthesis.d.ts +0 -17
- package/dist/learning/synthesis.d.ts.map +0 -1
- package/dist/learning/synthesis.js +0 -293
- package/dist/learning/synthesis.js.map +0 -1
- package/dist/learning/types.d.ts +0 -60
- package/dist/learning/types.d.ts.map +0 -1
- package/dist/learning/types.js +0 -17
- package/dist/learning/types.js.map +0 -1
- package/dist/recommend/index.d.ts +0 -3
- package/dist/recommend/index.d.ts.map +0 -1
- package/dist/recommend/index.js +0 -14
- package/dist/recommend/index.js.map +0 -1
- package/dist/recommend/ordered-logistic.d.ts +0 -49
- package/dist/recommend/ordered-logistic.d.ts.map +0 -1
- package/dist/recommend/ordered-logistic.js +0 -153
- package/dist/recommend/ordered-logistic.js.map +0 -1
- package/dist/recommend/questions.d.ts +0 -19
- package/dist/recommend/questions.d.ts.map +0 -1
- package/dist/recommend/questions.js +0 -73
- package/dist/recommend/questions.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [2.0.0] - 2025-12-15
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
- **Audit Command** - `vibe-check audit` for static analysis of code messes (monoliths, test gaps, TODOs)
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
- **ESM Migration** - Package is now pure ESM (`type: module`). Requires Node.js 20+.
|
|
17
|
+
- **Dependencies** - Updated all dependencies to December 2025 latest versions.
|
|
18
|
+
- **Chalk v5** - Updated to `chalk` v5 (ESM only).
|
|
19
|
+
|
|
10
20
|
## [1.8.0] - 2025-12-05
|
|
11
21
|
|
|
12
22
|
### Added
|
package/CLAUDE.md
CHANGED
|
@@ -183,6 +183,13 @@ src/
|
|
|
183
183
|
├── score/
|
|
184
184
|
│ ├── index.ts # VibeScore calculation
|
|
185
185
|
│ └── weights.ts # Metric weights
|
|
186
|
+
├── inner-loop/
|
|
187
|
+
│ ├── index.ts # Inner loop failure detection aggregator
|
|
188
|
+
│ ├── types.ts # Types and configuration
|
|
189
|
+
│ ├── tests-passing-lie.ts # "Tests Passing" Lie detector
|
|
190
|
+
│ ├── context-amnesia.ts # Context Amnesia detector
|
|
191
|
+
│ ├── instruction-drift.ts # Instruction Drift detector
|
|
192
|
+
│ └── logging-only.ts # Debug Loop Spiral detector
|
|
186
193
|
└── output/
|
|
187
194
|
├── index.ts # Output format router
|
|
188
195
|
├── terminal.ts # Colored terminal output
|
|
@@ -276,3 +283,54 @@ A "debug spiral" is detected when 3+ consecutive fix commits target the same com
|
|
|
276
283
|
- `GITOPS_DRIFT` - Sync/reconciliation issues
|
|
277
284
|
|
|
278
285
|
**Coaching Integration:** Spirals are automatically recorded to `~/.vibe-check/spiral-history.ndjson`. Watch mode and session end show personalized advice based on what's worked before for you.
|
|
286
|
+
|
|
287
|
+
## Inner Loop Failure Pattern Detection
|
|
288
|
+
|
|
289
|
+
vibe-check detects the 4 "Inner Loop Disasters" from vibe coding:
|
|
290
|
+
|
|
291
|
+
| Pattern | Detects | How |
|
|
292
|
+
|---------|---------|-----|
|
|
293
|
+
| **"Tests Passing" Lie** | AI claims success but code doesn't work | Commits claiming "fix/done/working" followed by immediate fixes |
|
|
294
|
+
| **Context Amnesia** | AI forgets instructions, re-does work | Reverts, reimplementations, repeated similar fixes |
|
|
295
|
+
| **Instruction Drift** | AI "improves" things not asked for | Unrequested refactors, scope explosion, file changes outside intent |
|
|
296
|
+
| **Debug Loop Spiral** | AI adds logging instead of fixing | Consecutive commits adding console.log/print without fixes |
|
|
297
|
+
|
|
298
|
+
### Integration Points
|
|
299
|
+
|
|
300
|
+
**Session End Output:**
|
|
301
|
+
```json
|
|
302
|
+
{
|
|
303
|
+
"inner_loop": {
|
|
304
|
+
"health": "warning",
|
|
305
|
+
"issues_detected": 2,
|
|
306
|
+
"tests_passing_lies": 1,
|
|
307
|
+
"context_amnesia_incidents": 0,
|
|
308
|
+
"instruction_drift_commits": 1,
|
|
309
|
+
"debug_loop_detected": false,
|
|
310
|
+
"recommendations": ["..."]
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
**Watch Mode:** Real-time detection alerts when inner loop issues are detected.
|
|
316
|
+
|
|
317
|
+
### Architecture
|
|
318
|
+
|
|
319
|
+
```
|
|
320
|
+
src/inner-loop/
|
|
321
|
+
├── index.ts # Aggregates all detectors
|
|
322
|
+
├── types.ts # Inner loop types and config
|
|
323
|
+
├── tests-passing-lie.ts # "Tests Passing" Lie detector
|
|
324
|
+
├── context-amnesia.ts # Context Amnesia detector
|
|
325
|
+
├── instruction-drift.ts # Instruction Drift detector
|
|
326
|
+
└── logging-only.ts # Debug Loop Spiral (logging) detector
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
### Emergency Protocol
|
|
330
|
+
|
|
331
|
+
When critical inner loop failures are detected:
|
|
332
|
+
|
|
333
|
+
```
|
|
334
|
+
🚨 EMERGENCY PROTOCOL: Multiple inner loop failures detected.
|
|
335
|
+
STOP → git status → backup → start simple
|
|
336
|
+
```
|
package/Makefile
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# vibe-check Makefile
|
|
2
2
|
# All npm commands and development shortcuts
|
|
3
3
|
|
|
4
|
-
.PHONY: help build dev start test test-coverage lint clean install publish dashboard watch profile analyze session-start session-end
|
|
4
|
+
.PHONY: help build dev start test test-coverage lint clean install publish dashboard watch profile analyze session-start session-end release-patch release-minor release-major github-release
|
|
5
5
|
|
|
6
6
|
# Default target
|
|
7
7
|
help:
|
|
@@ -19,12 +19,13 @@ help:
|
|
|
19
19
|
@echo " make test-coverage - Run tests with coverage report"
|
|
20
20
|
@echo " make test-watch - Run tests in watch mode"
|
|
21
21
|
@echo ""
|
|
22
|
-
@echo "Publishing:"
|
|
22
|
+
@echo "Publishing & Releases:"
|
|
23
|
+
@echo " make release-patch - Full release: patch version (1.0.x)"
|
|
24
|
+
@echo " make release-minor - Full release: minor version (1.x.0)"
|
|
25
|
+
@echo " make release-major - Full release: major version (x.0.0)"
|
|
26
|
+
@echo " make github-release - Create GitHub release for current version"
|
|
27
|
+
@echo " make publish - npm publish only (no git/github)"
|
|
23
28
|
@echo " make install - Install dependencies"
|
|
24
|
-
@echo " make publish - Build, test, and publish to npm"
|
|
25
|
-
@echo " make version-patch - Bump patch version (1.0.x)"
|
|
26
|
-
@echo " make version-minor - Bump minor version (1.x.0)"
|
|
27
|
-
@echo " make version-major - Bump major version (x.0.0)"
|
|
28
29
|
@echo ""
|
|
29
30
|
@echo "Vibe-Check Commands:"
|
|
30
31
|
@echo " make dashboard - Open visual dashboard"
|
|
@@ -88,6 +89,42 @@ version-minor:
|
|
|
88
89
|
version-major:
|
|
89
90
|
npm version major
|
|
90
91
|
|
|
92
|
+
# ============================================
|
|
93
|
+
# Release Workflow (Full Automation)
|
|
94
|
+
# ============================================
|
|
95
|
+
|
|
96
|
+
# Full release: bump, tag, push, GitHub release, npm publish
|
|
97
|
+
release-patch: build test
|
|
98
|
+
@echo "📦 Releasing patch version..."
|
|
99
|
+
npm version patch -m "chore(release): %s"
|
|
100
|
+
git push --follow-tags
|
|
101
|
+
$(MAKE) github-release
|
|
102
|
+
npm publish --access=public
|
|
103
|
+
@echo "✅ Released v$$(npm pkg get version | tr -d '"')"
|
|
104
|
+
|
|
105
|
+
release-minor: build test
|
|
106
|
+
@echo "📦 Releasing minor version..."
|
|
107
|
+
npm version minor -m "chore(release): %s"
|
|
108
|
+
git push --follow-tags
|
|
109
|
+
$(MAKE) github-release
|
|
110
|
+
npm publish --access=public
|
|
111
|
+
@echo "✅ Released v$$(npm pkg get version | tr -d '"')"
|
|
112
|
+
|
|
113
|
+
release-major: build test
|
|
114
|
+
@echo "📦 Releasing major version..."
|
|
115
|
+
npm version major -m "chore(release): %s"
|
|
116
|
+
git push --follow-tags
|
|
117
|
+
$(MAKE) github-release
|
|
118
|
+
npm publish --access=public
|
|
119
|
+
@echo "✅ Released v$$(npm pkg get version | tr -d '"')"
|
|
120
|
+
|
|
121
|
+
# Create GitHub release from latest tag
|
|
122
|
+
github-release:
|
|
123
|
+
@VERSION=$$(npm pkg get version | tr -d '"'); \
|
|
124
|
+
gh release create "v$$VERSION" \
|
|
125
|
+
--title "v$$VERSION" \
|
|
126
|
+
--generate-notes
|
|
127
|
+
|
|
91
128
|
# ============================================
|
|
92
129
|
# Vibe-Check Commands
|
|
93
130
|
# ============================================
|
package/README.md
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
<p align="center">
|
|
16
16
|
Git-powered metrics for AI-assisted development.<br>
|
|
17
|
-
Detects the failure patterns from <a href="https://itrevolution.com/product/vibe-coding-book/"><em>Vibe Coding</em></a> (Gene Kim & Steve Yegge, 2025).
|
|
17
|
+
Detects the <a href="#the-12-failure-patterns">12 failure patterns</a> from <a href="https://itrevolution.com/product/vibe-coding-book/"><em>Vibe Coding</em></a> (Gene Kim & Steve Yegge, 2025).
|
|
18
18
|
</p>
|
|
19
19
|
|
|
20
20
|
---
|
|
@@ -29,6 +29,21 @@ npx @boshu2/vibe-check
|
|
|
29
29
|
|
|
30
30
|
---
|
|
31
31
|
|
|
32
|
+
## Focus: The Inner Developer Loop
|
|
33
|
+
|
|
34
|
+
vibe-check focuses on detecting the **4 Inner Loop Disasters** — the immediate, developer-facing failures that happen during a coding session:
|
|
35
|
+
|
|
36
|
+
| Pattern | What Goes Wrong | How vibe-check Detects It |
|
|
37
|
+
|---------|-----------------|---------------------------|
|
|
38
|
+
| **"Tests Passing" Lie** | AI claims "fixed" but code doesn't work | Commits claiming success followed by immediate fixes |
|
|
39
|
+
| **Context Amnesia** | AI forgets instructions from 5 minutes ago | Reverts, reimplementations, repeated similar fixes |
|
|
40
|
+
| **Instruction Drift** | AI "improves" things you didn't ask for | Unrequested refactors, scope explosion |
|
|
41
|
+
| **Debug Loop Spiral** | AI adds logging instead of fixing root cause | 3+ consecutive debugging commits |
|
|
42
|
+
|
|
43
|
+
These are the patterns you can catch and fix **right now**, in your current session.
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
32
47
|
## The Problem
|
|
33
48
|
|
|
34
49
|
> "AI can destroy months of work in minutes." — Gene Kim & Steve Yegge
|
|
@@ -64,14 +79,42 @@ npx @boshu2/vibe-check dashboard
|
|
|
64
79
|
| **Rework Ratio** | Building or debugging? | <30% |
|
|
65
80
|
| **Debug Spirals** | Are you stuck? | 0 active |
|
|
66
81
|
|
|
67
|
-
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## The 12 Failure Patterns
|
|
85
|
+
|
|
86
|
+
*Vibe Coding* identifies 12 failure modes across three developer loops. vibe-check focuses on the **inner loop** (where spirals form) while providing awareness of all 12.
|
|
87
|
+
|
|
88
|
+
### Inner Loop (Minutes) — **Primary Focus**
|
|
89
|
+
|
|
90
|
+
| # | Pattern | Severity | vibe-check Detection |
|
|
91
|
+
|---|---------|----------|----------------------|
|
|
92
|
+
| 1 | **Tests Passing Lie** | 🔴 HIGH | Trust pass rate drops, fix commits follow "working" code |
|
|
93
|
+
| 2 | **Context Amnesia** | 🟡 MEDIUM | Repeated fixes on same component, circular patterns |
|
|
94
|
+
| 3 | **Instruction Drift** | 🟡 MEDIUM | Scope creep visible in commit message patterns |
|
|
95
|
+
| 4 | **Debug Loop Spiral** | 🔴 HIGH | ✅ **Core detection**: 3+ fix commits on same component |
|
|
96
|
+
|
|
97
|
+
### Middle Loop (Hours-Days) — *Monitored*
|
|
68
98
|
|
|
69
|
-
| Pattern | Severity |
|
|
70
|
-
|
|
71
|
-
| **
|
|
72
|
-
| **
|
|
73
|
-
|
|
|
74
|
-
| **
|
|
99
|
+
| # | Pattern | Severity | vibe-check Detection |
|
|
100
|
+
|---|---------|----------|----------------------|
|
|
101
|
+
| 5 | **Eldritch Code Horror** | 🔴 CRITICAL | High file churn, repeated touches to same files |
|
|
102
|
+
| 6 | **Workspace Collision** | 🔴 HIGH | — (multi-agent, future) |
|
|
103
|
+
| 7 | **Memory Decay** | 🟡 MEDIUM | Session baseline comparison shows degradation |
|
|
104
|
+
| 8 | **Multi-Agent Deadlock** | 🔴 HIGH | — (multi-agent, future) |
|
|
105
|
+
|
|
106
|
+
### Outer Loop (Weeks-Months) — *Awareness*
|
|
107
|
+
|
|
108
|
+
| # | Pattern | Severity | vibe-check Detection |
|
|
109
|
+
|---|---------|----------|----------------------|
|
|
110
|
+
| 9 | **Bridge Torching** | 🔴 CRITICAL | — (API tracking, future) |
|
|
111
|
+
| 10 | **Repository Deletion** | 🔴 CRITICAL | — (git safety, future) |
|
|
112
|
+
| 11 | **Process Gridlock** | 🔴 HIGH | — (CI/CD analysis, future) |
|
|
113
|
+
| 12 | **Stewnami** | 🔴 HIGH | — (cross-repo, future) |
|
|
114
|
+
|
|
115
|
+
> **Inner loop mastery prevents middle/outer loop disasters.** Catch the spiral at 3 commits, not 30.
|
|
116
|
+
|
|
117
|
+
See the [full 12 Failure Patterns catalog](https://github.com/boshu2/12-factor-agentops/blob/main/docs/reference/failure-patterns.md) for prevention strategies and AgentOps integration.
|
|
75
118
|
|
|
76
119
|
---
|
|
77
120
|
|
|
@@ -173,31 +216,41 @@ vibe-check session end --format json
|
|
|
173
216
|
"retro": {
|
|
174
217
|
"failure_patterns_hit": [],
|
|
175
218
|
"failure_patterns_avoided": ["Debug Spiral", "Context Amnesia"]
|
|
219
|
+
},
|
|
220
|
+
"inner_loop": {
|
|
221
|
+
"health": "healthy",
|
|
222
|
+
"issues_detected": 0,
|
|
223
|
+
"tests_passing_lies": 0,
|
|
224
|
+
"context_amnesia_incidents": 0,
|
|
225
|
+
"instruction_drift_commits": 0,
|
|
226
|
+
"debug_loop_detected": false
|
|
176
227
|
}
|
|
177
228
|
}
|
|
178
229
|
```
|
|
179
230
|
|
|
180
|
-
|
|
231
|
+
When inner loop issues are detected:
|
|
181
232
|
|
|
182
|
-
|
|
233
|
+
```
|
|
234
|
+
⚠️ Inner Loop Health: WARNING
|
|
183
235
|
|
|
184
|
-
|
|
236
|
+
🤥 2 "tests passing" lies detected
|
|
237
|
+
🎯 Instruction drift: 3 commits went outside scope
|
|
185
238
|
|
|
186
|
-
|
|
187
|
-
BUILD → WORK → RUN
|
|
188
|
-
12-Factor Agents Vibe Coding 12-Factor AgentOps
|
|
189
|
-
(HumanLayer) (Gene & Steve) (Operations)
|
|
190
|
-
↓
|
|
191
|
-
vibe-check
|
|
192
|
-
(Measurement)
|
|
239
|
+
→ STOP: AI claimed success but code needed fixes. Verify builds/tests pass.
|
|
193
240
|
```
|
|
194
241
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
242
|
+
---
|
|
243
|
+
|
|
244
|
+
## For Autonomous Agents
|
|
245
|
+
|
|
246
|
+
vibe-check measures **human-AI collaboration sessions**—the inner loop where you're working with an AI assistant.
|
|
247
|
+
|
|
248
|
+
For **autonomous agents** that run without a human in the loop, see [12-Factor AgentOps](https://12factoragentops.com)—DevOps and SRE patterns adapted for AI systems.
|
|
249
|
+
|
|
250
|
+
| Use Case | Tool |
|
|
251
|
+
|----------|------|
|
|
252
|
+
| Working *with* AI (pair programming) | vibe-check |
|
|
253
|
+
| Running AI *autonomously* (agents) | [12-Factor AgentOps](https://12factoragentops.com) |
|
|
201
254
|
|
|
202
255
|
---
|
|
203
256
|
|
|
@@ -222,10 +275,10 @@ It's not a productivity metric. It's not for performance reviews.
|
|
|
222
275
|
|
|
223
276
|
## Learn More
|
|
224
277
|
|
|
225
|
-
- [Vibe-Coding Ecosystem](docs/VIBE-ECOSYSTEM.md) — Full methodology, all features
|
|
226
278
|
- [Vibe Coding Book](https://itrevolution.com/product/vibe-coding-book/) — Gene Kim & Steve Yegge (2025)
|
|
227
|
-
- [12-Factor AgentOps](https://
|
|
228
|
-
- [12
|
|
279
|
+
- [12-Factor AgentOps](https://12factoragentops.com) — Reliability patterns for autonomous agents
|
|
280
|
+
- [12 Failure Patterns](https://github.com/boshu2/12-factor-agentops/blob/main/docs/reference/failure-patterns.md) — Complete catalog with prevention strategies
|
|
281
|
+
- [vibe-check on bofuller.com](https://bofuller.com/builds/vibe-check) — Trust calibration, 40% rule, and results
|
|
229
282
|
|
|
230
283
|
---
|
|
231
284
|
|
package/bin/vibe-check.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
2
|
+
import '../dist/cli.js';
|
package/claude-progress.json
CHANGED
|
@@ -218,6 +218,24 @@
|
|
|
218
218
|
"Plan before implement - actionable coaching plan guides next work"
|
|
219
219
|
]
|
|
220
220
|
}
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
"session_id": "2025-12-15-001",
|
|
224
|
+
"started": "2025-12-15T12:00:00Z",
|
|
225
|
+
"ended": "2025-12-15T12:05:00Z",
|
|
226
|
+
"vibe_level": 5,
|
|
227
|
+
"summary": "Updated dependencies to latest (Dec 2025). Bumped typescript to 5.9.3, types/node to 25.0.2. Fixed integration tests to account for stale git history.",
|
|
228
|
+
"commits": [],
|
|
229
|
+
"features_completed": []
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
"session_id": "2025-12-15-002",
|
|
233
|
+
"started": "2025-12-15T13:00:00Z",
|
|
234
|
+
"ended": "2025-12-15T13:30:00Z",
|
|
235
|
+
"vibe_level": 4,
|
|
236
|
+
"summary": "Implemented `vibe-check audit` command for static analysis. Detects monoliths (>600 lines), test gaps (missing test files), and TODO density.",
|
|
237
|
+
"commits": [],
|
|
238
|
+
"features_completed": ["VIBE-048"]
|
|
221
239
|
}
|
|
222
240
|
],
|
|
223
241
|
"sessions_continued": [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cross-session-analysis.d.ts","sourceRoot":"","sources":["../../src/analysis/cross-session-analysis.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"cross-session-analysis.d.ts","sourceRoot":"","sources":["../../src/analysis/cross-session-analysis.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,MAAM,WAAW,WAAW;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,IAAI,CAAC;IACb,KAAK,CAAC,EAAE,IAAI,CAAC;IACb,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,IAAI,CAAC;IAChB,QAAQ,EAAE,IAAI,CAAC;IACf,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,MAAM,WAAW,mBAAmB;IAClC,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE;QAAE,IAAI,EAAE,IAAI,CAAC;QAAC,EAAE,EAAE,IAAI,CAAA;KAAE,GAAG,IAAI,CAAC;IAC3C,OAAO,EAAE,UAAU,EAAE,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACrC;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,QAAQ,GAAE,MAAsB,GAAG,MAAM,EAAE,CAEzE;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,WAAW,GAAG,MAAM,EAAE,CAU7E;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,UAAU,EAAE,CAqC9D;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,mBAAmB,CAqD7E;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,SAAS,GAAE,MAAY,GAAG,UAAU,EAAE,CAK9F;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EAAE,CAKlF;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG;IACpE,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,KAAK,EAAE,UAAU,GAAG,IAAI,CAAC;IACzB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,YAAY,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;CACzC,CA8BA"}
|
|
@@ -1,27 +1,18 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.loadAllCommits = loadAllCommits;
|
|
4
|
-
exports.queryCommits = queryCommits;
|
|
5
|
-
exports.analyzeByScope = analyzeByScope;
|
|
6
|
-
exports.getCrossSessionSummary = getCrossSessionSummary;
|
|
7
|
-
exports.findProblematicScopes = findProblematicScopes;
|
|
8
|
-
exports.findPeakHours = findPeakHours;
|
|
9
|
-
exports.analyzeScopeDetail = analyzeScopeDetail;
|
|
10
1
|
/**
|
|
11
2
|
* Cross-session analysis for querying historical commit data.
|
|
12
3
|
* Enables queries like "show all auth spirals" or "commits by scope".
|
|
13
4
|
*/
|
|
14
|
-
|
|
5
|
+
import { readCommitLog } from '../storage/commit-log.js';
|
|
15
6
|
/**
|
|
16
7
|
* Load all commits from the NDJSON log
|
|
17
8
|
*/
|
|
18
|
-
function loadAllCommits(repoPath = process.cwd()) {
|
|
19
|
-
return
|
|
9
|
+
export function loadAllCommits(repoPath = process.cwd()) {
|
|
10
|
+
return readCommitLog(repoPath);
|
|
20
11
|
}
|
|
21
12
|
/**
|
|
22
13
|
* Query commits with filters
|
|
23
14
|
*/
|
|
24
|
-
function queryCommits(commits, filter) {
|
|
15
|
+
export function queryCommits(commits, filter) {
|
|
25
16
|
return commits.filter(commit => {
|
|
26
17
|
if (filter.scope && commit.scope !== filter.scope)
|
|
27
18
|
return false;
|
|
@@ -41,7 +32,7 @@ function queryCommits(commits, filter) {
|
|
|
41
32
|
/**
|
|
42
33
|
* Get statistics by scope
|
|
43
34
|
*/
|
|
44
|
-
function analyzeByScope(commits) {
|
|
35
|
+
export function analyzeByScope(commits) {
|
|
45
36
|
const scopeMap = new Map();
|
|
46
37
|
for (const commit of commits) {
|
|
47
38
|
const scope = commit.scope || '(no scope)';
|
|
@@ -74,7 +65,7 @@ function analyzeByScope(commits) {
|
|
|
74
65
|
/**
|
|
75
66
|
* Get comprehensive cross-session summary
|
|
76
67
|
*/
|
|
77
|
-
function getCrossSessionSummary(commits) {
|
|
68
|
+
export function getCrossSessionSummary(commits) {
|
|
78
69
|
if (commits.length === 0) {
|
|
79
70
|
return {
|
|
80
71
|
totalCommits: 0,
|
|
@@ -125,7 +116,7 @@ function getCrossSessionSummary(commits) {
|
|
|
125
116
|
/**
|
|
126
117
|
* Find scopes with high spiral ratios (potential trouble spots)
|
|
127
118
|
*/
|
|
128
|
-
function findProblematicScopes(commits, threshold = 0.5) {
|
|
119
|
+
export function findProblematicScopes(commits, threshold = 0.5) {
|
|
129
120
|
const byScope = analyzeByScope(commits);
|
|
130
121
|
return byScope
|
|
131
122
|
.filter(s => s.commitCount >= 3 && s.spiralRatio >= threshold)
|
|
@@ -134,7 +125,7 @@ function findProblematicScopes(commits, threshold = 0.5) {
|
|
|
134
125
|
/**
|
|
135
126
|
* Find peak productivity hours
|
|
136
127
|
*/
|
|
137
|
-
function findPeakHours(commits) {
|
|
128
|
+
export function findPeakHours(commits) {
|
|
138
129
|
const summary = getCrossSessionSummary(commits);
|
|
139
130
|
return Object.entries(summary.byHour)
|
|
140
131
|
.map(([hour, count]) => ({ hour: parseInt(hour), count }))
|
|
@@ -143,7 +134,7 @@ function findPeakHours(commits) {
|
|
|
143
134
|
/**
|
|
144
135
|
* Get commits for a specific scope with detailed analysis
|
|
145
136
|
*/
|
|
146
|
-
function analyzeScopeDetail(commits, scope) {
|
|
137
|
+
export function analyzeScopeDetail(commits, scope) {
|
|
147
138
|
const scopeCommits = commits.filter(c => c.scope === scope);
|
|
148
139
|
if (scopeCommits.length === 0) {
|
|
149
140
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cross-session-analysis.js","sourceRoot":"","sources":["../../src/analysis/cross-session-analysis.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cross-session-analysis.js","sourceRoot":"","sources":["../../src/analysis/cross-session-analysis.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,aAAa,EAAgB,MAAM,0BAA0B,CAAC;AAiCvE;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,WAAmB,OAAO,CAAC,GAAG,EAAE;IAC7D,OAAO,aAAa,CAAC,QAAQ,CAAC,CAAC;AACjC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,OAAiB,EAAE,MAAmB;IACjE,OAAO,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE;QAC7B,IAAI,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,K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AQ,CAAC;IAC1B,CAAC;IAED,OAAO;QACL,OAAO,EAAE,YAAY;QACrB,KAAK;QACL,cAAc;QACd,YAAY;KACb,CAAC;AACJ,CAAC"}
|
package/dist/analysis/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { QueryFilter, ScopeStats, CrossSessionSummary, loadAllCommits, queryCommits, analyzeByScope, getCrossSessionSummary, findProblematicScopes, findPeakHours, analyzeScopeDetail, } from './cross-session-analysis';
|
|
1
|
+
export { QueryFilter, ScopeStats, CrossSessionSummary, loadAllCommits, queryCommits, analyzeByScope, getCrossSessionSummary, findProblematicScopes, findPeakHours, analyzeScopeDetail, } from './cross-session-analysis.js';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/analysis/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,UAAU,EACV,mBAAmB,EACnB,cAAc,EACd,YAAY,EACZ,cAAc,EACd,sBAAsB,EACtB,qBAAqB,EACrB,aAAa,EACb,kBAAkB,GACnB,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/analysis/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,UAAU,EACV,mBAAmB,EACnB,cAAc,EACd,YAAY,EACZ,cAAc,EACd,sBAAsB,EACtB,qBAAqB,EACrB,aAAa,EACb,kBAAkB,GACnB,MAAM,6BAA6B,CAAC"}
|
package/dist/analysis/index.js
CHANGED
|
@@ -1,12 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.analyzeScopeDetail = exports.findPeakHours = exports.findProblematicScopes = exports.getCrossSessionSummary = exports.analyzeByScope = exports.queryCommits = exports.loadAllCommits = void 0;
|
|
4
|
-
var cross_session_analysis_1 = require("./cross-session-analysis");
|
|
5
|
-
Object.defineProperty(exports, "loadAllCommits", { enumerable: true, get: function () { return cross_session_analysis_1.loadAllCommits; } });
|
|
6
|
-
Object.defineProperty(exports, "queryCommits", { enumerable: true, get: function () { return cross_session_analysis_1.queryCommits; } });
|
|
7
|
-
Object.defineProperty(exports, "analyzeByScope", { enumerable: true, get: function () { return cross_session_analysis_1.analyzeByScope; } });
|
|
8
|
-
Object.defineProperty(exports, "getCrossSessionSummary", { enumerable: true, get: function () { return cross_session_analysis_1.getCrossSessionSummary; } });
|
|
9
|
-
Object.defineProperty(exports, "findProblematicScopes", { enumerable: true, get: function () { return cross_session_analysis_1.findProblematicScopes; } });
|
|
10
|
-
Object.defineProperty(exports, "findPeakHours", { enumerable: true, get: function () { return cross_session_analysis_1.findPeakHours; } });
|
|
11
|
-
Object.defineProperty(exports, "analyzeScopeDetail", { enumerable: true, get: function () { return cross_session_analysis_1.analyzeScopeDetail; } });
|
|
1
|
+
export { loadAllCommits, queryCommits, analyzeByScope, getCrossSessionSummary, findProblematicScopes, findPeakHours, analyzeScopeDetail, } from './cross-session-analysis.js';
|
|
12
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/analysis/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/analysis/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,cAAc,EACd,YAAY,EACZ,cAAc,EACd,sBAAsB,EACtB,qBAAqB,EACrB,aAAa,EACb,kBAAkB,GACnB,MAAM,6BAA6B,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export interface AuditResult {
|
|
2
|
+
monoliths: Monolith[];
|
|
3
|
+
testGaps: TestGap[];
|
|
4
|
+
todoDensity: TodoHotspot[];
|
|
5
|
+
stats: {
|
|
6
|
+
totalFiles: number;
|
|
7
|
+
totalLines: number;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
export interface Monolith {
|
|
11
|
+
file: string;
|
|
12
|
+
lines: number;
|
|
13
|
+
}
|
|
14
|
+
export interface TestGap {
|
|
15
|
+
file: string;
|
|
16
|
+
testFile: string | null;
|
|
17
|
+
lastModified: Date;
|
|
18
|
+
}
|
|
19
|
+
export interface TodoHotspot {
|
|
20
|
+
file: string;
|
|
21
|
+
count: number;
|
|
22
|
+
}
|
|
23
|
+
export declare function scanDirectory(dir: string, rootDir?: string): string[];
|
|
24
|
+
export declare function analyzeMonoliths(files: string[], limit?: number): Monolith[];
|
|
25
|
+
export declare function analyzeTodoDensity(files: string[], limit?: number): TodoHotspot[];
|
|
26
|
+
export declare function analyzeTestGaps(files: string[], rootDir: string): TestGap[];
|
|
27
|
+
export declare function runAudit(rootDir: string): AuditResult;
|
|
28
|
+
//# sourceMappingURL=audit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audit.d.ts","sourceRoot":"","sources":["../../src/analyzers/audit.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,WAAW;IAC1B,SAAS,EAAE,QAAQ,EAAE,CAAC;IACtB,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,WAAW,EAAE,WAAW,EAAE,CAAC;IAC3B,KAAK,EAAE;QACL,UAAU,EAAE,MAAM,CAAC;QACnB,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;CACH;AAED,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,YAAY,EAAE,IAAI,CAAC;CACpB;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAKD,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,GAAE,MAAY,GAAG,MAAM,EAAE,CAoB1E;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,KAAK,GAAE,MAAY,GAAG,QAAQ,EAAE,CAYjF;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,KAAK,GAAE,MAAU,GAAG,WAAW,EAAE,CAYpF;AAGD,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,EAAE,CA4B3E;AAED,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,WAAW,CAerD"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import * as fs from 'fs';
|
|
2
|
+
import * as path from 'path';
|
|
3
|
+
const IGNORE_DIRS = ['node_modules', 'dist', 'coverage', '.git', '.vibe-check'];
|
|
4
|
+
const TEST_EXTENSIONS = ['.test.ts', '.spec.ts', '.test.js', '.spec.js'];
|
|
5
|
+
export function scanDirectory(dir, rootDir = dir) {
|
|
6
|
+
let results = [];
|
|
7
|
+
const list = fs.readdirSync(dir);
|
|
8
|
+
for (const file of list) {
|
|
9
|
+
const filePath = path.join(dir, file);
|
|
10
|
+
const stat = fs.statSync(filePath);
|
|
11
|
+
if (stat && stat.isDirectory()) {
|
|
12
|
+
if (!IGNORE_DIRS.includes(file)) {
|
|
13
|
+
results = results.concat(scanDirectory(filePath, rootDir));
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
// Only include source files
|
|
18
|
+
if (file.match(/\.(ts|js|jsx|tsx)$/)) {
|
|
19
|
+
results.push(filePath);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return results;
|
|
24
|
+
}
|
|
25
|
+
export function analyzeMonoliths(files, limit = 600) {
|
|
26
|
+
const monoliths = [];
|
|
27
|
+
for (const file of files) {
|
|
28
|
+
const content = fs.readFileSync(file, 'utf-8');
|
|
29
|
+
const lines = content.split('\n').length;
|
|
30
|
+
if (lines > limit) {
|
|
31
|
+
monoliths.push({ file, lines });
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return monoliths.sort((a, b) => b.lines - a.lines);
|
|
35
|
+
}
|
|
36
|
+
export function analyzeTodoDensity(files, limit = 5) {
|
|
37
|
+
const hotspots = [];
|
|
38
|
+
for (const file of files) {
|
|
39
|
+
const content = fs.readFileSync(file, 'utf-8');
|
|
40
|
+
const matches = content.match(/\/\/\s*(TODO|FIXME)/gi);
|
|
41
|
+
if (matches && matches.length >= limit) {
|
|
42
|
+
hotspots.push({ file, count: matches.length });
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return hotspots.sort((a, b) => b.count - a.count);
|
|
46
|
+
}
|
|
47
|
+
// Simple heuristic: if src/foo.ts exists, look for src/foo.test.ts or tests/foo.test.ts
|
|
48
|
+
export function analyzeTestGaps(files, rootDir) {
|
|
49
|
+
const gaps = [];
|
|
50
|
+
const sourceFiles = files.filter(f => !f.match(/\.(test|spec)\./) && !f.includes('/tests/'));
|
|
51
|
+
for (const file of sourceFiles) {
|
|
52
|
+
const fileName = path.basename(file, path.extname(file));
|
|
53
|
+
const relativePath = path.relative(rootDir, file);
|
|
54
|
+
// Potential test locations
|
|
55
|
+
const candidates = [
|
|
56
|
+
file.replace(/\.(ts|js|tsx|jsx)$/, '.test.$1'),
|
|
57
|
+
file.replace(/\.(ts|js|tsx|jsx)$/, '.spec.$1'),
|
|
58
|
+
path.join(rootDir, 'tests', `${fileName}.test.ts`),
|
|
59
|
+
path.join(rootDir, 'tests', relativePath.replace(/\.(ts|js|tsx|jsx)$/, '.test.$1'))
|
|
60
|
+
];
|
|
61
|
+
const hasTest = candidates.some(c => fs.existsSync(c));
|
|
62
|
+
if (!hasTest) {
|
|
63
|
+
gaps.push({
|
|
64
|
+
file: relativePath,
|
|
65
|
+
testFile: null,
|
|
66
|
+
lastModified: fs.statSync(file).mtime
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return gaps;
|
|
71
|
+
}
|
|
72
|
+
export function runAudit(rootDir) {
|
|
73
|
+
const files = scanDirectory(rootDir);
|
|
74
|
+
const totalFiles = files.length;
|
|
75
|
+
let totalLines = 0;
|
|
76
|
+
files.forEach(f => {
|
|
77
|
+
totalLines += fs.readFileSync(f, 'utf-8').split('\n').length;
|
|
78
|
+
});
|
|
79
|
+
return {
|
|
80
|
+
monoliths: analyzeMonoliths(files),
|
|
81
|
+
testGaps: analyzeTestGaps(files, rootDir),
|
|
82
|
+
todoDensity: analyzeTodoDensity(files),
|
|
83
|
+
stats: { totalFiles, totalLines }
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=audit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audit.js","sourceRoot":"","sources":["../../src/analyzers/audit.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AA6B7B,MAAM,WAAW,GAAG,CAAC,cAAc,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,aAAa,CAAC,CAAC;AAChF,MAAM,eAAe,GAAG,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;AAEzE,MAAM,UAAU,aAAa,CAAC,GAAW,EAAE,UAAkB,GAAG;IAC9D,IAAI,OAAO,GAAa,EAAE,CAAC;IAC3B,MAAM,IAAI,GAAG,EAAE,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IAEjC,KAAK,MAAM,IAAI,IAAI,IAAI,EAAE,CAAC;QACxB,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QACtC,MAAM,IAAI,GAAG,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QAEnC,IAAI,IAAI,IA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