@boshu2/vibe-check 1.0.1 → 1.1.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/.agents/bundles/ml-learning-loop-complete-plan-2025-11-28.md +908 -0
- package/.agents/bundles/unified-vibe-system-plan-phase1-2025-11-28.md +962 -0
- package/.agents/bundles/unified-vibe-system-research-2025-11-28.md +1003 -0
- package/.agents/bundles/vibe-check-ecosystem-plan-2025-11-29.md +635 -0
- package/.agents/bundles/vibe-check-gamification-complete-2025-11-29.md +132 -0
- package/.agents/bundles/vibe-score-scientific-framework-2025-11-28.md +602 -0
- package/.vibe-check/calibration.json +38 -0
- package/.vibe-check/latest.json +114 -0
- package/CHANGELOG.md +46 -0
- package/CLAUDE.md +178 -0
- package/README.md +265 -63
- package/action.yml +270 -0
- package/dashboard/app.js +494 -0
- package/dashboard/index.html +235 -0
- package/dashboard/styles.css +647 -0
- package/dist/calibration/ece.d.ts +26 -0
- package/dist/calibration/ece.d.ts.map +1 -0
- package/dist/calibration/ece.js +93 -0
- package/dist/calibration/ece.js.map +1 -0
- package/dist/calibration/index.d.ts +3 -0
- package/dist/calibration/index.d.ts.map +1 -0
- package/dist/calibration/index.js +15 -0
- package/dist/calibration/index.js.map +1 -0
- package/dist/calibration/storage.d.ts +34 -0
- package/dist/calibration/storage.d.ts.map +1 -0
- package/dist/calibration/storage.js +188 -0
- package/dist/calibration/storage.js.map +1 -0
- package/dist/cli.js +30 -76
- package/dist/cli.js.map +1 -1
- package/dist/commands/analyze.d.ts +16 -0
- package/dist/commands/analyze.d.ts.map +1 -0
- package/dist/commands/analyze.js +256 -0
- package/dist/commands/analyze.js.map +1 -0
- package/dist/commands/index.d.ts +4 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/index.js +11 -0
- package/dist/commands/index.js.map +1 -0
- package/dist/commands/level.d.ts +3 -0
- package/dist/commands/level.d.ts.map +1 -0
- package/dist/commands/level.js +277 -0
- package/dist/commands/level.js.map +1 -0
- package/dist/commands/profile.d.ts +4 -0
- package/dist/commands/profile.d.ts.map +1 -0
- package/dist/commands/profile.js +143 -0
- package/dist/commands/profile.js.map +1 -0
- package/dist/gamification/achievements.d.ts +15 -0
- package/dist/gamification/achievements.d.ts.map +1 -0
- package/dist/gamification/achievements.js +273 -0
- package/dist/gamification/achievements.js.map +1 -0
- package/dist/gamification/index.d.ts +8 -0
- package/dist/gamification/index.d.ts.map +1 -0
- package/dist/gamification/index.js +30 -0
- package/dist/gamification/index.js.map +1 -0
- package/dist/gamification/profile.d.ts +46 -0
- package/dist/gamification/profile.d.ts.map +1 -0
- package/dist/gamification/profile.js +272 -0
- package/dist/gamification/profile.js.map +1 -0
- package/dist/gamification/streaks.d.ts +26 -0
- package/dist/gamification/streaks.d.ts.map +1 -0
- package/dist/gamification/streaks.js +132 -0
- package/dist/gamification/streaks.js.map +1 -0
- package/dist/gamification/types.d.ts +111 -0
- package/dist/gamification/types.d.ts.map +1 -0
- package/dist/gamification/types.js +26 -0
- package/dist/gamification/types.js.map +1 -0
- package/dist/gamification/xp.d.ts +37 -0
- package/dist/gamification/xp.d.ts.map +1 -0
- package/dist/gamification/xp.js +115 -0
- package/dist/gamification/xp.js.map +1 -0
- package/dist/git.d.ts +11 -0
- package/dist/git.d.ts.map +1 -1
- package/dist/git.js +52 -0
- package/dist/git.js.map +1 -1
- package/dist/metrics/code-stability.d.ts +13 -0
- package/dist/metrics/code-stability.d.ts.map +1 -0
- package/dist/metrics/code-stability.js +74 -0
- package/dist/metrics/code-stability.js.map +1 -0
- package/dist/metrics/file-churn.d.ts +8 -0
- package/dist/metrics/file-churn.d.ts.map +1 -0
- package/dist/metrics/file-churn.js +75 -0
- package/dist/metrics/file-churn.js.map +1 -0
- package/dist/metrics/time-spiral.d.ts +8 -0
- package/dist/metrics/time-spiral.d.ts.map +1 -0
- package/dist/metrics/time-spiral.js +69 -0
- package/dist/metrics/time-spiral.js.map +1 -0
- package/dist/metrics/velocity-anomaly.d.ts +13 -0
- package/dist/metrics/velocity-anomaly.d.ts.map +1 -0
- package/dist/metrics/velocity-anomaly.js +67 -0
- package/dist/metrics/velocity-anomaly.js.map +1 -0
- package/dist/output/index.d.ts +6 -3
- package/dist/output/index.d.ts.map +1 -1
- package/dist/output/index.js +4 -3
- package/dist/output/index.js.map +1 -1
- package/dist/output/json.d.ts +2 -2
- package/dist/output/json.d.ts.map +1 -1
- package/dist/output/json.js +54 -0
- package/dist/output/json.js.map +1 -1
- package/dist/output/markdown.d.ts +2 -2
- package/dist/output/markdown.d.ts.map +1 -1
- package/dist/output/markdown.js +34 -1
- package/dist/output/markdown.js.map +1 -1
- package/dist/output/terminal.d.ts +6 -2
- package/dist/output/terminal.d.ts.map +1 -1
- package/dist/output/terminal.js +131 -3
- package/dist/output/terminal.js.map +1 -1
- package/dist/recommend/index.d.ts +3 -0
- package/dist/recommend/index.d.ts.map +1 -0
- package/dist/recommend/index.js +14 -0
- package/dist/recommend/index.js.map +1 -0
- package/dist/recommend/ordered-logistic.d.ts +49 -0
- package/dist/recommend/ordered-logistic.d.ts.map +1 -0
- package/dist/recommend/ordered-logistic.js +153 -0
- package/dist/recommend/ordered-logistic.js.map +1 -0
- package/dist/recommend/questions.d.ts +19 -0
- package/dist/recommend/questions.d.ts.map +1 -0
- package/dist/recommend/questions.js +73 -0
- package/dist/recommend/questions.js.map +1 -0
- package/dist/score/index.d.ts +21 -0
- package/dist/score/index.d.ts.map +1 -0
- package/dist/score/index.js +48 -0
- package/dist/score/index.js.map +1 -0
- package/dist/score/weights.d.ts +16 -0
- package/dist/score/weights.d.ts.map +1 -0
- package/dist/score/weights.js +28 -0
- package/dist/score/weights.js.map +1 -0
- package/dist/types.d.ts +83 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +10 -9
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createInitialXP = createInitialXP;
|
|
4
|
+
exports.calculateSessionXP = calculateSessionXP;
|
|
5
|
+
exports.addXP = addXP;
|
|
6
|
+
exports.getLevelForXP = getLevelForXP;
|
|
7
|
+
exports.formatXPProgress = formatXPProgress;
|
|
8
|
+
exports.formatLevel = formatLevel;
|
|
9
|
+
exports.getLevelProgress = getLevelProgress;
|
|
10
|
+
const types_1 = require("./types");
|
|
11
|
+
/**
|
|
12
|
+
* Create initial XP state
|
|
13
|
+
*/
|
|
14
|
+
function createInitialXP() {
|
|
15
|
+
return {
|
|
16
|
+
total: 0,
|
|
17
|
+
level: 1,
|
|
18
|
+
levelName: types_1.LEVELS[0].name,
|
|
19
|
+
currentLevelXP: 0,
|
|
20
|
+
nextLevelXP: types_1.LEVELS[0].maxXP,
|
|
21
|
+
lastSessionXP: 0,
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Calculate XP earned from a session
|
|
26
|
+
*/
|
|
27
|
+
function calculateSessionXP(session, streak, achievementsUnlocked) {
|
|
28
|
+
let xp = 0;
|
|
29
|
+
// Base XP from rating
|
|
30
|
+
switch (session.overall) {
|
|
31
|
+
case 'ELITE':
|
|
32
|
+
xp += types_1.XP_REWARDS.eliteSession;
|
|
33
|
+
break;
|
|
34
|
+
case 'HIGH':
|
|
35
|
+
xp += types_1.XP_REWARDS.highSession;
|
|
36
|
+
break;
|
|
37
|
+
case 'MEDIUM':
|
|
38
|
+
xp += types_1.XP_REWARDS.mediumSession;
|
|
39
|
+
break;
|
|
40
|
+
case 'LOW':
|
|
41
|
+
xp += types_1.XP_REWARDS.lowSession;
|
|
42
|
+
break;
|
|
43
|
+
}
|
|
44
|
+
// Daily check-in bonus
|
|
45
|
+
xp += types_1.XP_REWARDS.dailyCheckIn;
|
|
46
|
+
// Streak bonus
|
|
47
|
+
xp += types_1.XP_REWARDS.streakBonus * Math.min(streak.current, 30); // Cap at 30 days
|
|
48
|
+
// Bonus for no spirals
|
|
49
|
+
if (session.spirals === 0 && session.commits >= 10) {
|
|
50
|
+
xp += types_1.XP_REWARDS.noSpirals;
|
|
51
|
+
}
|
|
52
|
+
// Achievement bonuses
|
|
53
|
+
xp += achievementsUnlocked * types_1.XP_REWARDS.achievementBase;
|
|
54
|
+
return xp;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Add XP and handle level ups
|
|
58
|
+
*/
|
|
59
|
+
function addXP(currentXP, earnedXP) {
|
|
60
|
+
const newTotal = currentXP.total + earnedXP;
|
|
61
|
+
const { level, levelInfo } = getLevelForXP(newTotal);
|
|
62
|
+
const leveledUp = level > currentXP.level;
|
|
63
|
+
const newXP = {
|
|
64
|
+
total: newTotal,
|
|
65
|
+
level,
|
|
66
|
+
levelName: levelInfo.name,
|
|
67
|
+
currentLevelXP: newTotal - levelInfo.minXP,
|
|
68
|
+
nextLevelXP: levelInfo.maxXP - levelInfo.minXP,
|
|
69
|
+
lastSessionXP: earnedXP,
|
|
70
|
+
};
|
|
71
|
+
return {
|
|
72
|
+
xp: newXP,
|
|
73
|
+
leveledUp,
|
|
74
|
+
newLevel: leveledUp ? levelInfo : undefined,
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Get level for given XP amount
|
|
79
|
+
*/
|
|
80
|
+
function getLevelForXP(xp) {
|
|
81
|
+
for (let i = types_1.LEVELS.length - 1; i >= 0; i--) {
|
|
82
|
+
if (xp >= types_1.LEVELS[i].minXP) {
|
|
83
|
+
return { level: types_1.LEVELS[i].level, levelInfo: types_1.LEVELS[i] };
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return { level: 1, levelInfo: types_1.LEVELS[0] };
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Format XP progress for display
|
|
90
|
+
*/
|
|
91
|
+
function formatXPProgress(xp) {
|
|
92
|
+
const levelInfo = types_1.LEVELS.find(l => l.level === xp.level);
|
|
93
|
+
const progress = xp.currentLevelXP / xp.nextLevelXP;
|
|
94
|
+
const barLength = 20;
|
|
95
|
+
const filled = Math.round(progress * barLength);
|
|
96
|
+
const empty = barLength - filled;
|
|
97
|
+
const bar = '█'.repeat(filled) + '░'.repeat(empty);
|
|
98
|
+
return `Level ${xp.level} ${levelInfo.name} ${levelInfo.icon}\n${bar} ${xp.currentLevelXP}/${xp.nextLevelXP} XP`;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Format level for compact display
|
|
102
|
+
*/
|
|
103
|
+
function formatLevel(xp) {
|
|
104
|
+
const levelInfo = types_1.LEVELS.find(l => l.level === xp.level);
|
|
105
|
+
return `Level ${xp.level} ${levelInfo.name} ${levelInfo.icon}`;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Get progress percentage to next level
|
|
109
|
+
*/
|
|
110
|
+
function getLevelProgress(xp) {
|
|
111
|
+
if (xp.nextLevelXP === Infinity)
|
|
112
|
+
return 100;
|
|
113
|
+
return Math.round((xp.currentLevelXP / xp.nextLevelXP) * 100);
|
|
114
|
+
}
|
|
115
|
+
//# sourceMappingURL=xp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"xp.js","sourceRoot":"","sources":["../../src/gamification/xp.ts"],"names":[],"mappings":";;AAKA,0CASC;AAKD,gDAsCC;AAKD,sBAoBC;AAKD,sCAOC;AAKD,4CAUC;AAKD,kCAGC;AAKD,4CAGC;AA7HD,mCAAkF;AAElF;;GAEG;AACH,SAAgB,eAAe;IAC7B,OAAO;QACL,KAAK,EAAE,CAAC;QACR,KAAK,EAAE,CAAC;QACR,SAAS,EAAE,cAAM,CAAC,CAAC,CAAC,CAAC,IAAI;QACzB,cAAc,EAAE,CAAC;QACjB,WAAW,EAAE,cAAM,CAAC,CAAC,CAAC,CAAC,KAAK;QAC5B,aAAa,EAAE,CAAC;KACjB,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,SAAgB,kBAAkB,CAChC,OAAsB,EACtB,MAAmB,EACnB,oBAA4B;IAE5B,IAAI,EAAE,GA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,KAAK,CAAC,CAAC;IAEnD,OAAO,SAAS,EAAE,CAAC,KAAK,IAAI,SAAS,CAAC,IAAI,IAAI,SAAS,CAAC,IAAI,KAAK,GAAG,IAAI,EAAE,CAAC,cAAc,IAAI,EAAE,CAAC,WAAW,KAAK,CAAC;AACnH,CAAC;AAED;;GAEG;AACH,SAAgB,WAAW,CAAC,EAAW;IACrC,MAAM,SAAS,GAAG,cAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,EAAE,CAAC,KAAK,CAAE,CAAC;IAC1D,OAAO,SAAS,EAAE,CAAC,KAAK,IAAI,SAAS,CAAC,IAAI,IAAI,SAAS,CAAC,IAAI,EAAE,CAAC;AACjE,CAAC;AAED;;GAEG;AACH,SAAgB,gBAAgB,CAAC,EAAW;IAC1C,IAAI,EAAE,CAAC,WAAW,KAAK,QAAQ;QAAE,OAAO,GAAG,CAAC;IAC5C,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,cAAc,GAAG,EAAE,CAAC,WAAW,CAAC,GAAG,GAAG,CAAC,CAAC;AAChE,CAAC"}
|
package/dist/git.d.ts
CHANGED
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
import { Commit } from './types';
|
|
2
2
|
export declare function getCommits(repoPath: string, since?: string, until?: string): Promise<Commit[]>;
|
|
3
3
|
export declare function isGitRepo(repoPath: string): Promise<boolean>;
|
|
4
|
+
export interface FileStats {
|
|
5
|
+
filesPerCommit: Map<string, string[]>;
|
|
6
|
+
lineStats: {
|
|
7
|
+
additions: number;
|
|
8
|
+
deletions: number;
|
|
9
|
+
}[];
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Get file-level statistics for semantic-free metrics.
|
|
13
|
+
*/
|
|
14
|
+
export declare function getFileStats(repoPath: string, since?: string, until?: string): Promise<FileStats>;
|
|
4
15
|
//# sourceMappingURL=git.d.ts.map
|
package/dist/git.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../src/git.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAIjC,wBAAsB,UAAU,CAC9B,QAAQ,EAAE,MAAM,EAChB,KAAK,CAAC,EAAE,MAAM,EACd,KAAK,CAAC,EAAE,MAAM,GACb,OAAO,CAAC,MAAM,EAAE,CAAC,CAuBnB;AA+BD,wBAAsB,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAQlE"}
|
|
1
|
+
{"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../src/git.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAIjC,wBAAsB,UAAU,CAC9B,QAAQ,EAAE,MAAM,EAChB,KAAK,CAAC,EAAE,MAAM,EACd,KAAK,CAAC,EAAE,MAAM,GACb,OAAO,CAAC,MAAM,EAAE,CAAC,CAuBnB;AA+BD,wBAAsB,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAQlE;AAED,MAAM,WAAW,SAAS;IACxB,cAAc,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IACtC,SAAS,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CACvD;AAED;;GAEG;AACH,wBAAsB,YAAY,CAChC,QAAQ,EAAE,MAAM,EAChB,KAAK,CAAC,EAAE,MAAM,EACd,KAAK,CAAC,EAAE,MAAM,GACb,OAAO,CAAC,SAAS,CAAC,CAmDpB"}
|
package/dist/git.js
CHANGED
|
@@ -5,6 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.getCommits = getCommits;
|
|
7
7
|
exports.isGitRepo = isGitRepo;
|
|
8
|
+
exports.getFileStats = getFileStats;
|
|
8
9
|
const simple_git_1 = __importDefault(require("simple-git"));
|
|
9
10
|
const COMMIT_TYPES = ['feat', 'fix', 'docs', 'chore', 'refactor', 'test', 'style'];
|
|
10
11
|
async function getCommits(repoPath, since, until) {
|
|
@@ -61,4 +62,55 @@ async function isGitRepo(repoPath) {
|
|
|
61
62
|
return false;
|
|
62
63
|
}
|
|
63
64
|
}
|
|
65
|
+
/**
|
|
66
|
+
* Get file-level statistics for semantic-free metrics.
|
|
67
|
+
*/
|
|
68
|
+
async function getFileStats(repoPath, since, until) {
|
|
69
|
+
const git = (0, simple_git_1.default)(repoPath);
|
|
70
|
+
const filesPerCommit = new Map();
|
|
71
|
+
const lineStats = [];
|
|
72
|
+
// Build options for git log
|
|
73
|
+
const logOptions = {};
|
|
74
|
+
if (since)
|
|
75
|
+
logOptions['--since'] = since;
|
|
76
|
+
if (until)
|
|
77
|
+
logOptions['--until'] = until;
|
|
78
|
+
try {
|
|
79
|
+
// Get log with file names
|
|
80
|
+
const log = await git.log(logOptions);
|
|
81
|
+
for (const commit of log.all) {
|
|
82
|
+
const hash = commit.hash.substring(0, 7);
|
|
83
|
+
// Get diff stats for this commit
|
|
84
|
+
try {
|
|
85
|
+
const diffStat = await git.raw(['diff-tree', '--numstat', '--root', '-r', commit.hash]);
|
|
86
|
+
const lines = diffStat.trim().split('\n').filter(l => l.length > 0);
|
|
87
|
+
const files = [];
|
|
88
|
+
let additions = 0;
|
|
89
|
+
let deletions = 0;
|
|
90
|
+
for (const line of lines) {
|
|
91
|
+
const parts = line.split('\t');
|
|
92
|
+
if (parts.length >= 3) {
|
|
93
|
+
const add = parseInt(parts[0], 10) || 0;
|
|
94
|
+
const del = parseInt(parts[1], 10) || 0;
|
|
95
|
+
const file = parts[2];
|
|
96
|
+
additions += add;
|
|
97
|
+
deletions += del;
|
|
98
|
+
files.push(file);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
filesPerCommit.set(hash, files);
|
|
102
|
+
lineStats.push({ additions, deletions });
|
|
103
|
+
}
|
|
104
|
+
catch {
|
|
105
|
+
// If diff-tree fails, just record empty
|
|
106
|
+
filesPerCommit.set(hash, []);
|
|
107
|
+
lineStats.push({ additions: 0, deletions: 0 });
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
catch {
|
|
112
|
+
// Return empty stats on error - silent fail
|
|
113
|
+
}
|
|
114
|
+
return { filesPerCommit, lineStats };
|
|
115
|
+
}
|
|
64
116
|
//# sourceMappingURL=git.js.map
|
package/dist/git.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"git.js","sourceRoot":"","sources":["../src/git.ts"],"names":[],"mappings":";;;;;AAKA,gCA2BC;AA+BD,8BAQC;
|
|
1
|
+
{"version":3,"file":"git.js","sourceRoot":"","sources":["../src/git.ts"],"names":[],"mappings":";;;;;AAKA,gCA2BC;AA+BD,8BAQC;AAUD,oCAuDC;AAxID,4DAA+E;AAG/E,MAAM,YAAY,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,CAAU,CAAC;AAErF,KAAK,UAAU,UAAU,CAC9B,QAAgB,EAChB,KAAc,EACd,KAAc;IAEd,MAAM,GAAG,GAAc,IAAA,oBAAS,EAAC,QAAQ,CAAC,CAAC;IAE3C,4BAA4B;IAC5B,MAAM,OAAO,GAA8C,EAAE,CAAC;IAE9D,IAAI,KAAK,EAAE,CAAC;QACV,OAAO,CAAC,SAAS,CAAC,GAAG,KAAK,CAAC;IAC7B,CAAC;IACD,IAAI,KAAK,EAAE,CAAC;QACV,OAAO,CAAC,SAAS,CAAC,GAAG,KAAK,CAAC;IAC7B,CAAC;IAED,IAAI,CAAC;QACH,MAAM,GAAG,GAAgC,MAAM,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAEhE,OAAO,GAAG,CAA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
/**
|
|
3
|
+
* Calculate code stability score.
|
|
4
|
+
* Measures what percentage of added lines survive.
|
|
5
|
+
*
|
|
6
|
+
* NOTE: Full implementation requires git blame analysis.
|
|
7
|
+
* This is a simplified version using addition/deletion ratios.
|
|
8
|
+
*/
|
|
9
|
+
export declare function calculateCodeStability(commits: Commit[], stats?: {
|
|
10
|
+
additions: number;
|
|
11
|
+
deletions: number;
|
|
12
|
+
}[]): CodeStabilityResult;
|
|
13
|
+
//# sourceMappingURL=code-stability.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code-stability.d.ts","sourceRoot":"","sources":["../../src/metrics/code-stability.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,mBAAmB,EAAU,MAAM,UAAU,CAAC;AAE/D;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,MAAM,EAAE,EACjB,KAAK,CAAC,EAAE;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,EAAE,GACjD,mBAAmB,CAiCrB"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.calculateCodeStability = calculateCodeStability;
|
|
4
|
+
/**
|
|
5
|
+
* Calculate code stability score.
|
|
6
|
+
* Measures what percentage of added lines survive.
|
|
7
|
+
*
|
|
8
|
+
* NOTE: Full implementation requires git blame analysis.
|
|
9
|
+
* This is a simplified version using addition/deletion ratios.
|
|
10
|
+
*/
|
|
11
|
+
function calculateCodeStability(commits, stats) {
|
|
12
|
+
if (!stats || stats.length === 0) {
|
|
13
|
+
// Without stats, estimate from commit patterns
|
|
14
|
+
return estimateStability(commits);
|
|
15
|
+
}
|
|
16
|
+
let totalAdditions = 0;
|
|
17
|
+
let totalDeletions = 0;
|
|
18
|
+
for (const stat of stats) {
|
|
19
|
+
totalAdditions += stat.additions;
|
|
20
|
+
totalDeletions += stat.deletions;
|
|
21
|
+
}
|
|
22
|
+
// Stability = net retention
|
|
23
|
+
// If deletions > additions, code is being removed (refactoring)
|
|
24
|
+
// If additions > deletions, code is being added
|
|
25
|
+
// High churn (both high) = low stability
|
|
26
|
+
const churnRate = totalAdditions > 0
|
|
27
|
+
? Math.min(totalDeletions / totalAdditions, 1.0)
|
|
28
|
+
: 0;
|
|
29
|
+
const score = 1 - (churnRate * 0.5); // Partial penalty for deletions
|
|
30
|
+
return {
|
|
31
|
+
value: Math.round(score * 100),
|
|
32
|
+
unit: '%',
|
|
33
|
+
rating: getStabilityRating(score),
|
|
34
|
+
description: getStabilityDescription(score, totalAdditions, totalDeletions),
|
|
35
|
+
linesAdded: totalAdditions,
|
|
36
|
+
linesSurviving: Math.round(totalAdditions * score),
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
function estimateStability(commits) {
|
|
40
|
+
// Without line stats, use commit message patterns
|
|
41
|
+
const fixCommits = commits.filter(c => c.message.toLowerCase().includes('fix') ||
|
|
42
|
+
c.message.toLowerCase().includes('revert') ||
|
|
43
|
+
c.message.toLowerCase().includes('undo')).length;
|
|
44
|
+
const fixRatio = commits.length > 0 ? fixCommits / commits.length : 0;
|
|
45
|
+
const score = 1 - fixRatio;
|
|
46
|
+
return {
|
|
47
|
+
value: Math.round(score * 100),
|
|
48
|
+
unit: '%',
|
|
49
|
+
rating: getStabilityRating(score),
|
|
50
|
+
description: `Estimated: ${Math.round(fixRatio * 100)}% fix/revert commits`,
|
|
51
|
+
linesAdded: 0,
|
|
52
|
+
linesSurviving: 0,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
function getStabilityRating(score) {
|
|
56
|
+
if (score >= 0.85)
|
|
57
|
+
return 'elite';
|
|
58
|
+
if (score >= 0.70)
|
|
59
|
+
return 'high';
|
|
60
|
+
if (score >= 0.50)
|
|
61
|
+
return 'medium';
|
|
62
|
+
return 'low';
|
|
63
|
+
}
|
|
64
|
+
function getStabilityDescription(score, added, deleted) {
|
|
65
|
+
const pct = Math.round(score * 100);
|
|
66
|
+
if (score >= 0.85)
|
|
67
|
+
return `Elite: ${pct}% stability (+${added}/-${deleted})`;
|
|
68
|
+
if (score >= 0.70)
|
|
69
|
+
return `High: ${pct}% stability (+${added}/-${deleted})`;
|
|
70
|
+
if (score >= 0.50)
|
|
71
|
+
return `Medium: ${pct}% stability (+${added}/-${deleted})`;
|
|
72
|
+
return `Low: ${pct}% stability (+${added}/-${deleted}) - high churn`;
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=code-stability.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code-stability.js","sourceRoot":"","sources":["../../src/metrics/code-stability.ts"],"names":[],"mappings":";;AASA,wDAoCC;AA3CD;;;;;;GAMG;AACH,SAAgB,sBAAsB,CACpC,OAAiB,EACjB,KAAkD;IAElD,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACjC,+CAA+C;QAC/C,OAAO,iBAAiB,CAAC,OAAO,CAAC,CAAC;IACpC,CAAC;IAED,IAAI,cAAc,GAAG,CAAC,CAAC;IACvB,IAAI,cAAc,GAAG,CAAC,CAAC;IAEvB,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,cAAc,IAAI,IAAI,CAAC,SAAS,CAAC;QACjC,cAAc,IAAI,IAAI,CAAC,SAAS,CAAC;IACnC,CAAC;IAED,4BAA4B;IAC5B,gEAAgE;IAChE,gDAAgD;IAChD,yCAAyC;IAEzC,MAAM,SAAS,GAAG,cAAc,GAAG,CAAC;QAClC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,cAAc,GAAG,cAAc,EAAE,GAAG,CAAC;QAChD,CAAC,CAAC,CAAC,CAAC;IAEN,MAAM,KAAK,GAAG,CAAC,GAAG,CAAC,SAAS,GAAG,GAAG,CAAC,CAAC,CAAC,gCAAgC;IAErE,OAAO;QACL,KA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O,CAAC;IAClC,IAAI,KAAK,IAAI,IAAI;QAAE,OAAO,MAAM,CAAC;IACjC,IAAI,KAAK,IAAI,IAAI;QAAE,OAAO,QAAQ,CAAC;IACnC,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,uBAAuB,CAAC,KAAa,EAAE,KAAa,EAAE,OAAe;IAC5E,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,GAAG,CAAC,CAAC;IACpC,IAAI,KAAK,IAAI,IAAI;QAAE,OAAO,UAAU,GAAG,iBAAiB,KAAK,KAAK,OAAO,GAAG,CAAC;IAC7E,IAAI,KAAK,IAAI,IAAI;QAAE,OAAO,SAAS,GAAG,iBAAiB,KAAK,KAAK,OAAO,GAAG,CAAC;IAC5E,IAAI,KAAK,IAAI,IAAI;QAAE,OAAO,WAAW,GAAG,iBAAiB,KAAK,KAAK,OAAO,GAAG,CAAC;IAC9E,OAAO,QAAQ,GAAG,iBAAiB,KAAK,KAAK,OAAO,gBAAgB,CAAC;AACvE,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Commit, FileChurnResult } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Calculate file churn score.
|
|
4
|
+
* Files touched 3+ times within 1 hour indicate thrashing.
|
|
5
|
+
* Works WITHOUT semantic commits.
|
|
6
|
+
*/
|
|
7
|
+
export declare function calculateFileChurn(commits: Commit[], filesPerCommit: Map<string, string[]>): FileChurnResult;
|
|
8
|
+
//# sourceMappingURL=file-churn.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-churn.d.ts","sourceRoot":"","sources":["../../src/metrics/file-churn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,eAAe,EAAU,MAAM,UAAU,CAAC;AAiB3D;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,MAAM,EAAE,EACjB,cAAc,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,GACpC,eAAe,CAuCjB"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.calculateFileChurn = calculateFileChurn;
|
|
4
|
+
const ONE_HOUR_MS = 60 * 60 * 1000;
|
|
5
|
+
/**
|
|
6
|
+
* Churn threshold: 3+ touches to same file within 1 hour suggests thrashing.
|
|
7
|
+
*
|
|
8
|
+
* Rationale: Healthy development typically touches a file 1-2 times per
|
|
9
|
+
* feature. Returning to the same file 3+ times in an hour often indicates:
|
|
10
|
+
* - Incomplete understanding before starting
|
|
11
|
+
* - Cascading changes from unexpected dependencies
|
|
12
|
+
* - Debugging loops
|
|
13
|
+
*
|
|
14
|
+
* NOT empirically validated. Your mileage may vary.
|
|
15
|
+
*/
|
|
16
|
+
const CHURN_THRESHOLD = 3;
|
|
17
|
+
/**
|
|
18
|
+
* Calculate file churn score.
|
|
19
|
+
* Files touched 3+ times within 1 hour indicate thrashing.
|
|
20
|
+
* Works WITHOUT semantic commits.
|
|
21
|
+
*/
|
|
22
|
+
function calculateFileChurn(commits, filesPerCommit) {
|
|
23
|
+
// Track file touch timestamps
|
|
24
|
+
const fileTouchTimes = new Map();
|
|
25
|
+
for (const commit of commits) {
|
|
26
|
+
const files = filesPerCommit.get(commit.hash) || [];
|
|
27
|
+
for (const file of files) {
|
|
28
|
+
const times = fileTouchTimes.get(file) || [];
|
|
29
|
+
times.push(commit.date);
|
|
30
|
+
fileTouchTimes.set(file, times);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
// Count files with 3+ touches in 1 hour
|
|
34
|
+
let churnedFiles = 0;
|
|
35
|
+
for (const [_file, times] of fileTouchTimes) {
|
|
36
|
+
const sorted = times.sort((a, b) => a.getTime() - b.getTime());
|
|
37
|
+
for (let i = 0; i <= sorted.length - CHURN_THRESHOLD; i++) {
|
|
38
|
+
const span = sorted[i + CHURN_THRESHOLD - 1].getTime() - sorted[i].getTime();
|
|
39
|
+
if (span < ONE_HOUR_MS) {
|
|
40
|
+
churnedFiles++;
|
|
41
|
+
break; // Count each file only once
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
const totalFiles = fileTouchTimes.size;
|
|
46
|
+
const churnRatio = totalFiles > 0 ? churnedFiles / totalFiles : 0;
|
|
47
|
+
const score = 1 - churnRatio; // Invert: high score = low churn
|
|
48
|
+
return {
|
|
49
|
+
value: Math.round(score * 100),
|
|
50
|
+
unit: '%',
|
|
51
|
+
rating: getChurnRating(churnRatio),
|
|
52
|
+
description: getChurnDescription(churnRatio, churnedFiles, totalFiles),
|
|
53
|
+
churnedFiles,
|
|
54
|
+
totalFiles,
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
function getChurnRating(churnRatio) {
|
|
58
|
+
if (churnRatio < 0.10)
|
|
59
|
+
return 'elite';
|
|
60
|
+
if (churnRatio < 0.25)
|
|
61
|
+
return 'high';
|
|
62
|
+
if (churnRatio < 0.40)
|
|
63
|
+
return 'medium';
|
|
64
|
+
return 'low';
|
|
65
|
+
}
|
|
66
|
+
function getChurnDescription(ratio, churned, total) {
|
|
67
|
+
if (ratio < 0.10)
|
|
68
|
+
return `Elite: ${churned}/${total} files churned (<10%)`;
|
|
69
|
+
if (ratio < 0.25)
|
|
70
|
+
return `High: ${churned}/${total} files churned (10-25%)`;
|
|
71
|
+
if (ratio < 0.40)
|
|
72
|
+
return `Medium: ${churned}/${total} files churned (25-40%)`;
|
|
73
|
+
return `Low: ${churned}/${total} files churned (>40%) - significant thrashing`;
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=file-churn.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-churn.js","sourceRoot":"","sources":["../../src/metrics/file-churn.ts"],"names":[],"mappings":";;AAsBA,gDA0CC;AA9DD,MAAM,WAAW,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CA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* Commits <5 minutes apart indicate frustrated rapid iteration.
|
|
5
|
+
* Works WITHOUT semantic commits.
|
|
6
|
+
*/
|
|
7
|
+
export declare function calculateTimeSpiral(commits: Commit[]): TimeSpiralResult;
|
|
8
|
+
//# sourceMappingURL=time-spiral.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"time-spiral.d.ts","sourceRoot":"","sources":["../../src/metrics/time-spiral.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAU,MAAM,UAAU,CAAC;AAe5D;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,gBAAgB,CAiCvE"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.calculateTimeSpiral = calculateTimeSpiral;
|
|
4
|
+
/**
|
|
5
|
+
* Spiral threshold: commits < 5 minutes apart suggest frustrated iteration.
|
|
6
|
+
*
|
|
7
|
+
* Rationale: Based on practitioner observation that commits faster than
|
|
8
|
+
* "think → code → test → commit" cycle (~5-10 min) often indicate:
|
|
9
|
+
* - Quick fixes to previous commit
|
|
10
|
+
* - Debugging iterations
|
|
11
|
+
* - "Oops forgot to save" patterns
|
|
12
|
+
*
|
|
13
|
+
* NOT empirically validated. Adjust based on your workflow.
|
|
14
|
+
*/
|
|
15
|
+
const SPIRAL_THRESHOLD_MS = 5 * 60 * 1000;
|
|
16
|
+
/**
|
|
17
|
+
* Calculate time spiral score.
|
|
18
|
+
* Commits <5 minutes apart indicate frustrated rapid iteration.
|
|
19
|
+
* Works WITHOUT semantic commits.
|
|
20
|
+
*/
|
|
21
|
+
function calculateTimeSpiral(commits) {
|
|
22
|
+
if (commits.length < 2) {
|
|
23
|
+
return {
|
|
24
|
+
value: 100,
|
|
25
|
+
unit: '%',
|
|
26
|
+
rating: 'elite',
|
|
27
|
+
description: 'Insufficient commits for analysis',
|
|
28
|
+
spiralCommits: 0,
|
|
29
|
+
totalCommits: commits.length,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
const sorted = [...commits].sort((a, b) => a.date.getTime() - b.date.getTime());
|
|
33
|
+
let spiralCommits = 0;
|
|
34
|
+
for (let i = 1; i < sorted.length; i++) {
|
|
35
|
+
const gap = sorted[i].date.getTime() - sorted[i - 1].date.getTime();
|
|
36
|
+
if (gap < SPIRAL_THRESHOLD_MS) {
|
|
37
|
+
spiralCommits++;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
const spiralRatio = spiralCommits / commits.length;
|
|
41
|
+
const score = 1 - spiralRatio; // Invert: high score = low spiraling
|
|
42
|
+
return {
|
|
43
|
+
value: Math.round(score * 100),
|
|
44
|
+
unit: '%',
|
|
45
|
+
rating: getSpiralRating(spiralRatio),
|
|
46
|
+
description: getSpiralDescription(spiralRatio, spiralCommits, commits.length),
|
|
47
|
+
spiralCommits,
|
|
48
|
+
totalCommits: commits.length,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
function getSpiralRating(spiralRatio) {
|
|
52
|
+
if (spiralRatio < 0.15)
|
|
53
|
+
return 'elite';
|
|
54
|
+
if (spiralRatio < 0.30)
|
|
55
|
+
return 'high';
|
|
56
|
+
if (spiralRatio < 0.50)
|
|
57
|
+
return 'medium';
|
|
58
|
+
return 'low';
|
|
59
|
+
}
|
|
60
|
+
function getSpiralDescription(ratio, spiral, total) {
|
|
61
|
+
if (ratio < 0.15)
|
|
62
|
+
return `Elite: ${spiral}/${total} rapid commits (<15%)`;
|
|
63
|
+
if (ratio < 0.30)
|
|
64
|
+
return `High: ${spiral}/${total} rapid commits (15-30%)`;
|
|
65
|
+
if (ratio < 0.50)
|
|
66
|
+
return `Medium: ${spiral}/${total} rapid commits (30-50%)`;
|
|
67
|
+
return `Low: ${spiral}/${total} rapid commits (>50%) - frustrated iteration`;
|
|
68
|
+
}
|
|
69
|
+
//# sourceMapp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AEpE,OAAO;QACL,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,GAAG,CAAC;QAC9B,IAAI,EAAE,GAAG;QACT,MAAM,EAAE,eAAe,CAAC,WAAW,CAAC;QACpC,WAAW,EAAE,oBAAoB,CAAC,WAAW,EAAE,aAAa,EAAE,OAAO,CAAC,MAAM,CAAC;QAC7E,aAAa;QACb,YAAY,EAAE,OAAO,CAAC,MAAM;KAC7B,CAAC;AACJ,CAAC;AAED,SAAS,eAAe,CAAC,WAAmB;IAC1C,IAAI,WAAW,GAAG,IAAI;QAAE,OAAO,OAAO,CAAC;IACvC,IAAI,WAAW,GAAG,IAAI;QAAE,OAAO,MAAM,CAAC;IACtC,IAAI,WAAW,GAAG,IAAI;QAAE,OAAO,QAAQ,CAAC;IACxC,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,oBAAoB,CAAC,KAAa,EAAE,MAAc,EAAE,KAAa;IACxE,IAAI,KAAK,GAAG,IAAI;QAAE,OAAO,UAAU,MAAM,IAAI,KAAK,uBAAuB,CAAC;IAC1E,IAAI,KAAK,GAAG,IAAI;QAAE,OAAO,SAAS,MAAM,IAAI,KAAK,yBAAyB,CAAC;IAC3E,IAAI,KAAK,GAAG,IAAI;QAAE,OAAO,WAAW,MAAM,IAAI,KAAK,yBAAyB,CAAC;IAC7E,OAAO,QAAQ,MAAM,IAAI,KAAK,8CAA8C,CAAC;AAC/E,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Commit, VelocityAnomalyResult } from '../types';
|
|
2
|
+
interface Baseline {
|
|
3
|
+
mean: number;
|
|
4
|
+
stdDev: number;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Calculate velocity anomaly score.
|
|
8
|
+
* Measures how far current velocity is from personal baseline.
|
|
9
|
+
* Works WITHOUT semantic commits.
|
|
10
|
+
*/
|
|
11
|
+
export declare function calculateVelocityAnomaly(commits: Commit[], baseline?: Baseline): VelocityAnomalyResult;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=velocity-anomaly.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"velocity-anomaly.d.ts","sourceRoot":"","sources":["../../src/metrics/velocity-anomaly.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,qBAAqB,EAAU,MAAM,UAAU,CAAC;AAGjE,UAAU,QAAQ;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,MAAM,EAAE,EACjB,QAAQ,CAAC,EAAE,QAAQ,GAClB,qBAAqB,CAwCvB"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.calculateVelocityAnomaly = calculateVelocityAnomaly;
|
|
4
|
+
const velocity_1 = require("./velocity");
|
|
5
|
+
/**
|
|
6
|
+
* Calculate velocity anomaly score.
|
|
7
|
+
* Measures how far current velocity is from personal baseline.
|
|
8
|
+
* Works WITHOUT semantic commits.
|
|
9
|
+
*/
|
|
10
|
+
function calculateVelocityAnomaly(commits, baseline) {
|
|
11
|
+
const activeHours = (0, velocity_1.calculateActiveHours)(commits);
|
|
12
|
+
const currentVelocity = activeHours > 0 ? commits.length / activeHours : 0;
|
|
13
|
+
/**
|
|
14
|
+
* Default baseline when no historical data exists.
|
|
15
|
+
*
|
|
16
|
+
* Rationale:
|
|
17
|
+
* - 3 commits/hour assumes ~20 min work cycles
|
|
18
|
+
* - 1.5 stdDev allows 0-6 commits/hour as "normal" (±2σ)
|
|
19
|
+
*
|
|
20
|
+
* These are PLACEHOLDER values. The model learns your actual
|
|
21
|
+
* baseline from calibration samples over time.
|
|
22
|
+
*
|
|
23
|
+
* NOT empirically validated across developer populations.
|
|
24
|
+
*/
|
|
25
|
+
const defaultBaseline = {
|
|
26
|
+
mean: 3.0,
|
|
27
|
+
stdDev: 1.5,
|
|
28
|
+
};
|
|
29
|
+
const base = baseline || defaultBaseline;
|
|
30
|
+
// Z-score: how many std devs from personal mean
|
|
31
|
+
const zScore = base.stdDev > 0
|
|
32
|
+
? Math.abs(currentVelocity - base.mean) / base.stdDev
|
|
33
|
+
: 0;
|
|
34
|
+
// Sigmoid transform: z=0 → 1.0, z=2 → 0.12, z=3 → 0.05
|
|
35
|
+
const score = 1 / (1 + Math.exp(zScore - 1.5));
|
|
36
|
+
return {
|
|
37
|
+
value: Math.round(score * 100),
|
|
38
|
+
unit: '%',
|
|
39
|
+
rating: getAnomalyRating(zScore),
|
|
40
|
+
description: getAnomalyDescription(zScore, currentVelocity, base),
|
|
41
|
+
currentVelocity: Math.round(currentVelocity * 10) / 10,
|
|
42
|
+
baselineMean: base.mean,
|
|
43
|
+
baselineStdDev: base.stdDev,
|
|
44
|
+
zScore: Math.round(zScore * 100) / 100,
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
function getAnomalyRating(zScore) {
|
|
48
|
+
if (zScore < 1.0)
|
|
49
|
+
return 'elite';
|
|
50
|
+
if (zScore < 1.5)
|
|
51
|
+
return 'high';
|
|
52
|
+
if (zScore < 2.0)
|
|
53
|
+
return 'medium';
|
|
54
|
+
return 'low';
|
|
55
|
+
}
|
|
56
|
+
function getAnomalyDescription(zScore, velocity, base) {
|
|
57
|
+
const velStr = velocity.toFixed(1);
|
|
58
|
+
const baseStr = base.mean.toFixed(1);
|
|
59
|
+
if (zScore < 1.0)
|
|
60
|
+
return `Elite: ${velStr}/hr (near baseline ${baseStr}/hr)`;
|
|
61
|
+
if (zScore < 1.5)
|
|
62
|
+
return `High: ${velStr}/hr (${zScore.toFixed(1)}σ from baseline)`;
|
|
63
|
+
if (zScore < 2.0)
|
|
64
|
+
return `Medium: ${velStr}/hr (${zScore.toFixed(1)}σ from baseline)`;
|
|
65
|
+
return `Low: ${velStr}/hr (${zScore.toFixed(1)}σ from baseline) - unusual pattern`;
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=velocity-anomaly.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"velocity-anomaly.js","sourceRoot":"","sources":["../../src/metrics/velocity-anomaly.ts"],"names":[],"mappings":";;AAaA,4DA2CC;AAvDD,yCAAkD;AAOlD;;;;GAIG;AACH,SAAgB,wBAAwB,CACtC,OAAiB,EACjB,QAAmB;IAEnB,MAAM,WAAW,GAAG,IAAA,+BAAoB,EAAC,OAAO,CAAC,CAAC;IAClD,MAAM,eAAe,GAAG,WAAW,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;IAE3E;;;;;;;;;;;OAWG;IACH,MAAM,eAAe,GAAa;QAChC,IAAI,EAAE,GAAG;QACT,MAAM,EAAE,GAAG;KACZ,CAAC;IACF,MAAM,IAAI,GAAG,QAAQ,IAAI,eAAe,CAAC;IAEzC,gDAAgD;IAChD,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC;QAC5B,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,MAAM;QACrD,CAAC,CAAC,CAAC,CAAC;IAEN,uDAAuD;IACvD,MAAM,KAAK,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC;IAE/C,OAAO;QACL,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,GAAG,CAAC;QAC9B,IAAI,EAAE,GAAG;QACT,MAAM,EAAE,gBAAgB,CAAC,MAAM,CAAC;QAChC,WAAW,EAAE,qBAAqB,CAAC,MAAM,EAAE,eAAe,EAAE,IAAI,CAAC;QACjE,eAAe,EAAE,IAAI,CAAC,KAAK,CAAC,eAAe,GAAG,EAAE,CAAC,GAAG,EAAE;QACtD,YAAY,EAAE,IAAI,CAAC,IAAI;QACvB,cAAc,EAAE,IAAI,CAAC,MAAM;QAC3B,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,GAAG,CAAC,GAAG,GAAG;KACvC,CAAC;AACJ,CAAC;AAED,SAAS,gBAAgB,CAAC,MAAc;IACtC,IAAI,MAAM,GAAG,GAAG;QAAE,OAAO,OAAO,CAAC;IACjC,IAAI,MAAM,GAAG,GAAG;QAAE,OAAO,MAAM,CAAC;IAChC,IAAI,MAAM,GAAG,GAAG;QAAE,OAAO,QAAQ,CAAC;IAClC,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,qBAAqB,CAAC,MAAc,EAAE,QAAgB,EAAE,IAAc;IAC7E,MAAM,MAAM,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IACnC,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAErC,IAAI,MAAM,GAAG,GAAG;QAAE,OAAO,UAAU,MAAM,sBAAsB,OAAO,MAAM,CAAC;IAC7E,IAAI,MAAM,GAAG,GAAG;QAAE,OAAO,SAAS,MAAM,QAAQ,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,kBAAkB,CAAC;IACpF,IAAI,MAAM,GAAG,GAAG;QAAE,OAAO,WAAW,MAAM,QAAQ,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,kBAAkB,CAAC;IACtF,OAAO,QAAQ,MAAM,QAAQ,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,oCAAoC,CAAC;AACrF,CAAC"}
|
package/dist/output/index.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import { VibeCheckResult, OutputFormat } from '../types';
|
|
2
|
-
export
|
|
3
|
-
|
|
1
|
+
import { VibeCheckResult, VibeCheckResultV2, OutputFormat } from '../types';
|
|
2
|
+
export interface OutputOptions {
|
|
3
|
+
simple?: boolean;
|
|
4
|
+
}
|
|
5
|
+
export declare function formatOutput(result: VibeCheckResult | VibeCheckResultV2, format: OutputFormat, options?: OutputOptions): string;
|
|
6
|
+
export { formatTerminal, formatTerminalSimple } from './terminal';
|
|
4
7
|
export { formatJson } from './json';
|
|
5
8
|
export { formatMarkdown } from './markdown';
|
|
6
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/output/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/output/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAK5E,MAAM,WAAW,aAAa;IAC5B,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,wBAAgB,YAAY,CAC1B,MAAM,EAAE,eAAe,GAAG,iBAAiB,EAC3C,MAAM,EAAE,YAAY,EACpB,OAAO,GAAE,aAAkB,GAC1B,MAAM,CAUR;AAED,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/output/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.formatMarkdown = exports.formatJson = exports.formatTerminal = void 0;
|
|
3
|
+
exports.formatMarkdown = exports.formatJson = exports.formatTerminalSimple = exports.formatTerminal = void 0;
|
|
4
4
|
exports.formatOutput = formatOutput;
|
|
5
5
|
const terminal_1 = require("./terminal");
|
|
6
6
|
const json_1 = require("./json");
|
|
7
7
|
const markdown_1 = require("./markdown");
|
|
8
|
-
function formatOutput(result, format) {
|
|
8
|
+
function formatOutput(result, format, options = {}) {
|
|
9
9
|
switch (format) {
|
|
10
10
|
case 'json':
|
|
11
11
|
return (0, json_1.formatJson)(result);
|
|
@@ -13,11 +13,12 @@ function formatOutput(result, format) {
|
|
|
13
13
|
return (0, markdown_1.formatMarkdown)(result);
|
|
14
14
|
case 'terminal':
|
|
15
15
|
default:
|
|
16
|
-
return (0, terminal_1.formatTerminal)(result);
|
|
16
|
+
return options.simple ? (0, terminal_1.formatTerminalSimple)(result) : (0, terminal_1.formatTerminal)(result);
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
var terminal_2 = require("./terminal");
|
|
20
20
|
Object.defineProperty(exports, "formatTerminal", { enumerable: true, get: function () { return terminal_2.formatTerminal; } });
|
|
21
|
+
Object.defineProperty(exports, "formatTerminalSimple", { enumerable: true, get: function () { return terminal_2.formatTerminalSimple; } });
|
|
21
22
|
var json_2 = require("./json");
|
|
22
23
|
Object.defineProperty(exports, "formatJson", { enumerable: true, get: function () { return json_2.formatJson; } });
|
|
23
24
|
var markdown_2 = require("./markdown");
|