@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,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.calculateECE = calculateECE;
|
|
4
|
+
exports.assessOutcome = assessOutcome;
|
|
5
|
+
exports.inferTrueLevel = inferTrueLevel;
|
|
6
|
+
/**
|
|
7
|
+
* Expected Calibration Error (ECE).
|
|
8
|
+
* Measures how well predicted levels match declared levels.
|
|
9
|
+
*
|
|
10
|
+
* ECE = Σᵢ (nᵢ/N) × |accuracy(binᵢ) - confidence(binᵢ)|
|
|
11
|
+
*/
|
|
12
|
+
function calculateECE(samples) {
|
|
13
|
+
if (samples.length === 0)
|
|
14
|
+
return 0;
|
|
15
|
+
// Group by declared level
|
|
16
|
+
const bins = new Map();
|
|
17
|
+
for (let level = 0; level <= 5; level++) {
|
|
18
|
+
bins.set(level, []);
|
|
19
|
+
}
|
|
20
|
+
for (const sample of samples) {
|
|
21
|
+
const levelSamples = bins.get(sample.declaredLevel) || [];
|
|
22
|
+
levelSamples.push(sample);
|
|
23
|
+
bins.set(sample.declaredLevel, levelSamples);
|
|
24
|
+
}
|
|
25
|
+
// Expected score range for each level
|
|
26
|
+
const expectedRanges = {
|
|
27
|
+
5: { min: 0.90, max: 1.00 },
|
|
28
|
+
4: { min: 0.80, max: 0.90 },
|
|
29
|
+
3: { min: 0.65, max: 0.80 },
|
|
30
|
+
2: { min: 0.50, max: 0.70 },
|
|
31
|
+
1: { min: 0.30, max: 0.55 },
|
|
32
|
+
0: { min: 0.00, max: 0.40 },
|
|
33
|
+
};
|
|
34
|
+
let ece = 0;
|
|
35
|
+
for (const [level, levelSamples] of bins) {
|
|
36
|
+
if (levelSamples.length === 0)
|
|
37
|
+
continue;
|
|
38
|
+
const expected = expectedRanges[level];
|
|
39
|
+
const expectedCenter = (expected.min + expected.max) / 2;
|
|
40
|
+
const actualMean = levelSamples.reduce((sum, s) => sum + s.vibeScore, 0) / levelSamples.length;
|
|
41
|
+
ece += (levelSamples.length / samples.length) * Math.abs(actualMean - expectedCenter);
|
|
42
|
+
}
|
|
43
|
+
return Math.round(ece * 1000) / 1000;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Assess if a score matches the expected range for a level.
|
|
47
|
+
*/
|
|
48
|
+
function assessOutcome(vibeScore, declaredLevel) {
|
|
49
|
+
const expectedRanges = {
|
|
50
|
+
5: { min: 0.90, max: 1.00 },
|
|
51
|
+
4: { min: 0.80, max: 0.90 },
|
|
52
|
+
3: { min: 0.65, max: 0.80 },
|
|
53
|
+
2: { min: 0.50, max: 0.70 },
|
|
54
|
+
1: { min: 0.30, max: 0.55 },
|
|
55
|
+
0: { min: 0.00, max: 0.40 },
|
|
56
|
+
};
|
|
57
|
+
const expected = expectedRanges[declaredLevel];
|
|
58
|
+
if (vibeScore >= expected.min && vibeScore <= expected.max) {
|
|
59
|
+
return 'correct';
|
|
60
|
+
}
|
|
61
|
+
else if (vibeScore > expected.max) {
|
|
62
|
+
return 'too_low'; // Level was too conservative
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
return 'too_high'; // Level was too aggressive
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Infer the "true" vibe level from an actual vibe score.
|
|
70
|
+
* This is used to generate training labels for the model.
|
|
71
|
+
*
|
|
72
|
+
* Maps score ranges to levels:
|
|
73
|
+
* - 0.90-1.00 → 5 (Elite flow)
|
|
74
|
+
* - 0.80-0.90 → 4 (High flow)
|
|
75
|
+
* - 0.65-0.80 → 3 (Balanced)
|
|
76
|
+
* - 0.50-0.65 → 2 (AI-Augmented)
|
|
77
|
+
* - 0.30-0.50 → 1 (Human-Led)
|
|
78
|
+
* - 0.00-0.30 → 0 (Manual)
|
|
79
|
+
*/
|
|
80
|
+
function inferTrueLevel(vibeScore) {
|
|
81
|
+
if (vibeScore >= 0.90)
|
|
82
|
+
return 5;
|
|
83
|
+
if (vibeScore >= 0.80)
|
|
84
|
+
return 4;
|
|
85
|
+
if (vibeScore >= 0.65)
|
|
86
|
+
return 3;
|
|
87
|
+
if (vibeScore >= 0.50)
|
|
88
|
+
return 2;
|
|
89
|
+
if (vibeScore >= 0.30)
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EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE;QAC3B,CAAC,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE;KAC5B,CAAC;IAEF,MAAM,QAAQ,GAAG,cAAc,CAAC,aAAa,CAAC,CAAC;IAE/C,IAAI,SAAS,IAAI,QAAQ,CAAC,GAAG,IAAI,SAAS,IAAI,QAAQ,CAAC,GAAG,EAAE,CAAC;QAC3D,OAAO,SAAS,CAAC;IACnB,CAAC;SAAM,IAAI,SAAS,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC;QACpC,OAAO,SAAS,CAAC,CAAC,6BAA6B;IACjD,CAAC;SAAM,CAAC;QACN,OAAO,UAAU,CAAC,CAAC,2BAA2B;IAChD,CAAC;AACH,CAAC;AAED;;;;;;;;;;;GAWG;AACH,SAAgB,cAAc,CAAC,SAAiB;IAC9C,IAAI,SAAS,IAAI,IAAI;QAAE,OAAO,CAAC,CAAC;IAChC,IAAI,SAAS,IAAI,IAAI;QAAE,OAAO,CAAC,CAAC;IAChC,IAAI,SAAS,IAAI,IAAI;QAAE,OAAO,CAAC,CAAC;IAChC,IAAI,SAAS,IAAI,IAAI;QAAE,OAAO,CAAC,CAAC;IAChC,IAAI,SAAS,IAAI,IAAI;QAAE,OAAO,CAAC,CAAC;IAChC,OAAO,CAAC,CAAC;AACX,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/calibration/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,SAAS,EAAE,kBAAkB,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACnH,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.inferTrueLevel = exports.assessOutcome = exports.calculateECE = exports.forceRetrain = exports.retrain = exports.getCalibrationPath = exports.addSample = exports.saveCalibration = exports.loadCalibration = void 0;
|
|
4
|
+
var storage_1 = require("./storage");
|
|
5
|
+
Object.defineProperty(exports, "loadCalibration", { enumerable: true, get: function () { return storage_1.loadCalibration; } });
|
|
6
|
+
Object.defineProperty(exports, "saveCalibration", { enumerable: true, get: function () { return storage_1.saveCalibration; } });
|
|
7
|
+
Object.defineProperty(exports, "addSample", { enumerable: true, get: function () { return storage_1.addSample; } });
|
|
8
|
+
Object.defineProperty(exports, "getCalibrationPath", { enumerable: true, get: function () { return storage_1.getCalibrationPath; } });
|
|
9
|
+
Object.defineProperty(exports, "retrain", { enumerable: true, get: function () { return storage_1.retrain; } });
|
|
10
|
+
Object.defineProperty(exports, "forceRetrain", { enumerable: true, get: function () { return storage_1.forceRetrain; } });
|
|
11
|
+
var ece_1 = require("./ece");
|
|
12
|
+
Object.defineProperty(exports, "calculateECE", { enumerable: true, get: function () { return ece_1.calculateECE; } });
|
|
13
|
+
Object.defineProperty(exports, "assessOutcome", { enumerable: true, get: function () { return ece_1.assessOutcome; } });
|
|
14
|
+
Object.defineProperty(exports, "inferTrueLevel", { enumerable: true, get: function () { return ece_1.inferTrueLevel; } });
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/calibration/index.ts"],"names":[],"mappings":";;;AAAA,qCAAmH;AAA1G,0GAAA,eAAe,OAAA;AAAE,0GAAA,eAAe,OAAA;AAAE,oGAAA,SAAS,OAAA;AAAE,6GAAA,kBAAkB,OAAA;AAAE,kGAAA,OAAO,OAAA;AAAE,uGAAA,YAAY,OAAA;AAC/F,6BAAoE;AAA3D,mGAAA,YAAY,OAAA;AAAE,oGAAA,aAAa,OAAA;AAAE,qGAAA,cAAc,OAAA"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { CalibrationState, CalibrationSample } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Get calibration file path for a repository.
|
|
4
|
+
*/
|
|
5
|
+
export declare function getCalibrationPath(repoPath: string): string;
|
|
6
|
+
/**
|
|
7
|
+
* Load calibration state from disk.
|
|
8
|
+
*/
|
|
9
|
+
export declare function loadCalibration(repoPath: string): CalibrationState;
|
|
10
|
+
/**
|
|
11
|
+
* Save calibration state to disk.
|
|
12
|
+
*/
|
|
13
|
+
export declare function saveCalibration(repoPath: string, state: CalibrationState): void;
|
|
14
|
+
/**
|
|
15
|
+
* Add a calibration sample and potentially trigger retraining.
|
|
16
|
+
*
|
|
17
|
+
* Retraining is triggered when:
|
|
18
|
+
* 1. Sample count is a multiple of RETRAIN_SAMPLE_INTERVAL, OR
|
|
19
|
+
* 2. ECE exceeds RETRAIN_ECE_THRESHOLD
|
|
20
|
+
*
|
|
21
|
+
* Returns updated state with potentially new weights.
|
|
22
|
+
*/
|
|
23
|
+
export declare function addSample(repoPath: string, sample: CalibrationSample): CalibrationState;
|
|
24
|
+
/**
|
|
25
|
+
* Retrain the model using all accumulated samples.
|
|
26
|
+
*
|
|
27
|
+
* Uses batch partial fit with inferred true levels from vibe scores.
|
|
28
|
+
*/
|
|
29
|
+
export declare function retrain(state: CalibrationState): CalibrationState;
|
|
30
|
+
/**
|
|
31
|
+
* Force retraining (manual trigger).
|
|
32
|
+
*/
|
|
33
|
+
export declare function forceRetrain(repoPath: string): CalibrationState;
|
|
34
|
+
//# sourceMappingURL=storage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../src/calibration/storage.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAyB/D;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,gBAAgB,CAoBlE;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,gBAAgB,GAAG,IAAI,CAS/E;AAED;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CACvB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,iBAAiB,GACxB,gBAAgB,CAmBlB;AAED;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,gBAAgB,GAAG,gBAAgB,CAmCjE;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,gBAAgB,CAQ/D"}
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.getCalibrationPath = getCalibrationPath;
|
|
37
|
+
exports.loadCalibration = loadCalibration;
|
|
38
|
+
exports.saveCalibration = saveCalibration;
|
|
39
|
+
exports.addSample = addSample;
|
|
40
|
+
exports.retrain = retrain;
|
|
41
|
+
exports.forceRetrain = forceRetrain;
|
|
42
|
+
const fs = __importStar(require("fs"));
|
|
43
|
+
const path = __importStar(require("path"));
|
|
44
|
+
const ordered_logistic_1 = require("../recommend/ordered-logistic");
|
|
45
|
+
const ece_1 = require("./ece");
|
|
46
|
+
const CALIBRATION_DIR = '.vibe-check';
|
|
47
|
+
const CALIBRATION_FILE = 'calibration.json';
|
|
48
|
+
/**
|
|
49
|
+
* Retraining triggers for the calibration model.
|
|
50
|
+
*
|
|
51
|
+
* RETRAIN_SAMPLE_INTERVAL (10): Retrain every 10 samples to incorporate
|
|
52
|
+
* new data. Balances learning speed vs. computational cost.
|
|
53
|
+
*
|
|
54
|
+
* RETRAIN_ECE_THRESHOLD (0.15): If Expected Calibration Error exceeds 15%,
|
|
55
|
+
* the model's predictions are poorly calibrated. 15% chosen as "noticeable
|
|
56
|
+
* but not catastrophic" miscalibration.
|
|
57
|
+
*
|
|
58
|
+
* Note: With 14 parameters (9 weights + 5 thresholds), even 10 samples is
|
|
59
|
+
* severely underfitting. 20+ samples recommended for reliability.
|
|
60
|
+
*
|
|
61
|
+
* These values are NOT empirically optimized.
|
|
62
|
+
*/
|
|
63
|
+
const RETRAIN_SAMPLE_INTERVAL = 10;
|
|
64
|
+
const RETRAIN_ECE_THRESHOLD = 0.15;
|
|
65
|
+
/**
|
|
66
|
+
* Get calibration file path for a repository.
|
|
67
|
+
*/
|
|
68
|
+
function getCalibrationPath(repoPath) {
|
|
69
|
+
return path.join(repoPath, CALIBRATION_DIR, CALIBRATION_FILE);
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Load calibration state from disk.
|
|
73
|
+
*/
|
|
74
|
+
function loadCalibration(repoPath) {
|
|
75
|
+
const filePath = getCalibrationPath(repoPath);
|
|
76
|
+
if (fs.existsSync(filePath)) {
|
|
77
|
+
try {
|
|
78
|
+
const data = fs.readFileSync(filePath, 'utf-8');
|
|
79
|
+
const state = JSON.parse(data);
|
|
80
|
+
// Ensure dates are Date objects
|
|
81
|
+
state.lastUpdated = new Date(state.lastUpdated);
|
|
82
|
+
state.samples = state.samples.map((s) => ({
|
|
83
|
+
...s,
|
|
84
|
+
timestamp: new Date(s.timestamp),
|
|
85
|
+
}));
|
|
86
|
+
return state;
|
|
87
|
+
}
|
|
88
|
+
catch {
|
|
89
|
+
return defaultCalibrationState();
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return defaultCalibrationState();
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Save calibration state to disk.
|
|
96
|
+
*/
|
|
97
|
+
function saveCalibration(repoPath, state) {
|
|
98
|
+
const dirPath = path.join(repoPath, CALIBRATION_DIR);
|
|
99
|
+
const filePath = getCalibrationPath(repoPath);
|
|
100
|
+
if (!fs.existsSync(dirPath)) {
|
|
101
|
+
fs.mkdirSync(dirPath, { recursive: true });
|
|
102
|
+
}
|
|
103
|
+
fs.writeFileSync(filePath, JSON.stringify(state, null, 2));
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Add a calibration sample and potentially trigger retraining.
|
|
107
|
+
*
|
|
108
|
+
* Retraining is triggered when:
|
|
109
|
+
* 1. Sample count is a multiple of RETRAIN_SAMPLE_INTERVAL, OR
|
|
110
|
+
* 2. ECE exceeds RETRAIN_ECE_THRESHOLD
|
|
111
|
+
*
|
|
112
|
+
* Returns updated state with potentially new weights.
|
|
113
|
+
*/
|
|
114
|
+
function addSample(repoPath, sample) {
|
|
115
|
+
const state = loadCalibration(repoPath);
|
|
116
|
+
state.samples.push(sample);
|
|
117
|
+
state.lastUpdated = new Date();
|
|
118
|
+
// Check if retraining is needed
|
|
119
|
+
const shouldRetrain = state.samples.length % RETRAIN_SAMPLE_INTERVAL === 0 ||
|
|
120
|
+
state.ece > RETRAIN_ECE_THRESHOLD;
|
|
121
|
+
if (shouldRetrain && state.samples.length >= 5) {
|
|
122
|
+
const updatedState = retrain(state);
|
|
123
|
+
saveCalibration(repoPath, updatedState);
|
|
124
|
+
return updatedState;
|
|
125
|
+
}
|
|
126
|
+
// Just save without retraining
|
|
127
|
+
saveCalibration(repoPath, state);
|
|
128
|
+
return state;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Retrain the model using all accumulated samples.
|
|
132
|
+
*
|
|
133
|
+
* Uses batch partial fit with inferred true levels from vibe scores.
|
|
134
|
+
*/
|
|
135
|
+
function retrain(state) {
|
|
136
|
+
if (state.samples.length < 5) {
|
|
137
|
+
return state; // Not enough data
|
|
138
|
+
}
|
|
139
|
+
// Prepare training data: use vibeScore to infer "true" level
|
|
140
|
+
const trainingData = state.samples.map((sample) => ({
|
|
141
|
+
features: sample.features,
|
|
142
|
+
trueLevel: (0, ece_1.inferTrueLevel)(sample.vibeScore),
|
|
143
|
+
}));
|
|
144
|
+
// Start from default model (or could start from current weights)
|
|
145
|
+
const initialModel = {
|
|
146
|
+
weights: [...ordered_logistic_1.DEFAULT_MODEL.weights],
|
|
147
|
+
thresholds: [...ordered_logistic_1.DEFAULT_MODEL.thresholds],
|
|
148
|
+
};
|
|
149
|
+
// Train with multiple epochs for better convergence
|
|
150
|
+
let model = initialModel;
|
|
151
|
+
const epochs = Math.min(10, Math.ceil(50 / state.samples.length));
|
|
152
|
+
for (let epoch = 0; epoch < epochs; epoch++) {
|
|
153
|
+
model = (0, ordered_logistic_1.batchPartialFit)(model, trainingData, 0.05);
|
|
154
|
+
}
|
|
155
|
+
// Calculate new ECE
|
|
156
|
+
const newEce = (0, ece_1.calculateECE)(state.samples);
|
|
157
|
+
return {
|
|
158
|
+
...state,
|
|
159
|
+
weights: model.weights,
|
|
160
|
+
thresholds: model.thresholds,
|
|
161
|
+
ece: newEce,
|
|
162
|
+
lastUpdated: new Date(),
|
|
163
|
+
version: '2.1.0', // Bump version to indicate ML-learned weights
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Force retraining (manual trigger).
|
|
168
|
+
*/
|
|
169
|
+
function forceRetrain(repoPath) {
|
|
170
|
+
const state = loadCalibration(repoPath);
|
|
171
|
+
if (state.samples.length < 5) {
|
|
172
|
+
return state;
|
|
173
|
+
}
|
|
174
|
+
const updatedState = retrain(state);
|
|
175
|
+
saveCalibration(repoPath, updatedState);
|
|
176
|
+
return updatedState;
|
|
177
|
+
}
|
|
178
|
+
function defaultCalibrationState() {
|
|
179
|
+
return {
|
|
180
|
+
samples: [],
|
|
181
|
+
weights: ordered_logistic_1.DEFAULT_MODEL.weights,
|
|
182
|
+
thresholds: ordered_logistic_1.DEFAULT_MODEL.thresholds,
|
|
183
|
+
ece: 0,
|
|
184
|
+
lastUpdated: new Date(),
|
|
185
|
+
version: '2.0.0',
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
//# sourceMappingURL=storage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storage.js","sourceRoot":"","sources":["../../src/calibration/storage.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BA,gDAEC;AAKD,0CAoBC;AAKD,0CASC;AAWD,8BAsBC;AAOD,0BAmCC;AAKD,oC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,CAAC,CAAC;IACxC,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC7B,OAAO,KAAK,CAAC;IACf,CAAC;IACD,MAAM,YAAY,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;IACpC,eAAe,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;IACxC,OAAO,YAAY,CAAC;AACtB,CAAC;AAED,SAAS,uBAAuB;IAC9B,OAAO;QACL,OAAO,EAAE,EAAE;QACX,OAAO,EAAE,gCAAa,CAAC,OAAO;QAC9B,UAAU,EAAE,gCAAa,CAAC,UAAU;QACpC,GAAG,EAAE,CAAC;QACN,WAAW,EAAE,IAAI,IAAI,EAAE;QACvB,OAAO,EAAE,OAAO;KACjB,CAAC;AACJ,CAAC"}
|
package/dist/cli.js
CHANGED
|
@@ -1,92 +1,46 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict";
|
|
3
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
-
};
|
|
6
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
4
|
const commander_1 = require("commander");
|
|
8
|
-
const
|
|
9
|
-
const git_1 = require("./git");
|
|
10
|
-
const metrics_1 = require("./metrics");
|
|
11
|
-
const output_1 = require("./output");
|
|
5
|
+
const commands_1 = require("./commands");
|
|
12
6
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
13
7
|
const { version } = require('../package.json');
|
|
14
8
|
const program = new commander_1.Command();
|
|
15
9
|
program
|
|
16
10
|
.name('vibe-check')
|
|
17
|
-
.description('Measure vibe coding effectiveness
|
|
18
|
-
.version(version)
|
|
19
|
-
|
|
11
|
+
.description('Measure and classify vibe coding effectiveness')
|
|
12
|
+
.version(version);
|
|
13
|
+
// Add subcommands
|
|
14
|
+
program.addCommand((0, commands_1.createAnalyzeCommand)());
|
|
15
|
+
program.addCommand((0, commands_1.createLevelCommand)());
|
|
16
|
+
program.addCommand((0, commands_1.createProfileCommand)());
|
|
17
|
+
// Default behavior: if no subcommand, run analyze with passed options
|
|
18
|
+
// This maintains backwards compatibility with v1.x usage
|
|
19
|
+
program
|
|
20
|
+
.option('--since <date>', 'Start date for analysis (e.g., "1 week ago")')
|
|
20
21
|
.option('--until <date>', 'End date for analysis (default: now)')
|
|
21
22
|
.option('-f, --format <type>', 'Output format: terminal, json, markdown', 'terminal')
|
|
22
|
-
.option('-r, --repo <path>', 'Repository path
|
|
23
|
+
.option('-r, --repo <path>', 'Repository path', process.cwd())
|
|
23
24
|
.option('-v, --verbose', 'Show verbose output', false)
|
|
25
|
+
.option('--score', 'Include VibeScore and code pattern metrics', false)
|
|
26
|
+
.option('--recommend', 'Include level recommendation', false)
|
|
27
|
+
.option('--calibrate <level>', 'Record calibration sample with declared level (0-5)')
|
|
28
|
+
.option('-o, --output <file>', 'Write JSON results to file')
|
|
29
|
+
.option('-s, --simple', 'Simplified output (fewer details)', false)
|
|
24
30
|
.action(async (options) => {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
if (verbose) {
|
|
40
|
-
console.error(chalk_1.default.gray(`Analyzing repository: ${repo}`));
|
|
41
|
-
if (since)
|
|
42
|
-
console.error(chalk_1.default.gray(`Since: ${since}`));
|
|
43
|
-
if (until)
|
|
44
|
-
console.error(chalk_1.default.gray(`Until: ${until}`));
|
|
45
|
-
}
|
|
46
|
-
// Get commits
|
|
47
|
-
const commits = await (0, git_1.getCommits)(repo, since, until);
|
|
48
|
-
if (commits.length === 0) {
|
|
49
|
-
if (format === 'terminal') {
|
|
50
|
-
console.log(chalk_1.default.yellow('\nNo commits found in the specified range.\n'));
|
|
51
|
-
if (!since) {
|
|
52
|
-
console.log(chalk_1.default.gray('Try specifying a date range:'));
|
|
53
|
-
console.log(chalk_1.default.gray(' vibe-check --since "1 week ago"'));
|
|
54
|
-
console.log(chalk_1.default.gray(' vibe-check --since "2025-11-01"'));
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
else if (format === 'json') {
|
|
58
|
-
console.log(JSON.stringify({ error: 'No commits found', commits: 0 }));
|
|
59
|
-
}
|
|
60
|
-
else {
|
|
61
|
-
console.log('# Vibe-Check Report\n\nNo commits found in the specified range.');
|
|
62
|
-
}
|
|
63
|
-
process.exit(0);
|
|
64
|
-
}
|
|
65
|
-
if (verbose) {
|
|
66
|
-
console.error(chalk_1.default.gray(`Found ${commits.length} commits`));
|
|
67
|
-
}
|
|
68
|
-
// Analyze commits
|
|
69
|
-
const result = (0, metrics_1.analyzeCommits)(commits);
|
|
70
|
-
// Output result
|
|
71
|
-
const output = (0, output_1.formatOutput)(result, format);
|
|
72
|
-
console.log(output);
|
|
73
|
-
// Exit with appropriate code based on overall rating
|
|
74
|
-
if (result.overall === 'LOW') {
|
|
75
|
-
process.exit(1);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
catch (error) {
|
|
79
|
-
if (error instanceof Error) {
|
|
80
|
-
console.error(chalk_1.default.red(`Error: ${error.message}`));
|
|
81
|
-
if (options.verbose) {
|
|
82
|
-
console.error(chalk_1.default.gray(error.stack));
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
else {
|
|
86
|
-
console.error(chalk_1.default.red('An unexpected error occurred'));
|
|
87
|
-
}
|
|
88
|
-
process.exit(1);
|
|
89
|
-
}
|
|
31
|
+
// Default action runs analyze (backwards compatibility)
|
|
32
|
+
await (0, commands_1.runAnalyze)({
|
|
33
|
+
since: options.since,
|
|
34
|
+
until: options.until,
|
|
35
|
+
format: options.format,
|
|
36
|
+
repo: options.repo,
|
|
37
|
+
verbose: options.verbose,
|
|
38
|
+
score: options.score,
|
|
39
|
+
recommend: options.recommend,
|
|
40
|
+
calibrate: options.calibrate,
|
|
41
|
+
output: options.output,
|
|
42
|
+
simple: options.simple,
|
|
43
|
+
});
|
|
90
44
|
});
|
|
91
45
|
program.parse();
|
|
92
46
|
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;AAEA,yCAAoC;AACpC,yCAAwG;AAExG,8DAA8D;AAC9D,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAE/C,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,YAAY,CAAC;KAClB,WAAW,CAAC,gDAAgD,CAAC;KAC7D,OAAO,CAAC,OAAO,CAAC,CAAC;AAEpB,kBAAkB;AAClB,OAAO,CAAC,UAAU,CAAC,IAAA,+BAAoB,GAAE,CAAC,CAAC;AAC3C,OAAO,CAAC,UAAU,CAAC,IAAA,6BAAkB,GAAE,CAAC,CAAC;AACzC,OAAO,CAAC,UAAU,CAAC,IAAA,+BAAoB,GAAE,CAAC,CAAC;AAE3C,sEAAsE;AACtE,yDAAyD;AACzD,OAAO;KACJ,MAAM,CAAC,gBAAgB,EAAE,8CAA8C,CAAC;KACxE,MAAM,CAAC,gBAAgB,EAAE,sCAAsC,CAAC;KAChE,MAAM,CAAC,qBAAqB,EAAE,yCAAyC,EAAE,UAAU,CAAC;KACpF,MAAM,CAAC,mBAAmB,EAAE,iBAAiB,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC;KAC7D,MAAM,CAAC,eAAe,EAAE,qBAAqB,EAAE,KAAK,CAAC;KACrD,MAAM,CAAC,SAAS,EAAE,4CAA4C,EAAE,KAAK,CAAC;KACtE,MAAM,CAAC,aAAa,EAAE,8BAA8B,EAAE,KAAK,CAAC;KAC5D,MAAM,CAAC,qBAAqB,EAAE,qDAAqD,CAAC;KACpF,MAAM,CAAC,qBAAqB,EAAE,4BAA4B,CAAC;KAC3D,MAAM,CAAC,cAAc,EAAE,mCAAmC,EAAE,KAAK,CAAC;KAClE,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE;IACxB,wDAAwD;IACxD,MAAM,IAAA,qBAAU,EAAC;QACf,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,SAAS,EAAE,OAAO,CAAC,SAAS;QAC5B,SAAS,EAAE,OAAO,CAAC,SAAS;QAC5B,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,MAAM,EAAE,OAAO,CAAC,MAAM;KACvB,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEL,OAAO,CAAC,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
export interface AnalyzeOptions {
|
|
3
|
+
since?: string;
|
|
4
|
+
until?: string;
|
|
5
|
+
format: string;
|
|
6
|
+
repo: string;
|
|
7
|
+
verbose: boolean;
|
|
8
|
+
score: boolean;
|
|
9
|
+
recommend: boolean;
|
|
10
|
+
calibrate?: string;
|
|
11
|
+
output?: string;
|
|
12
|
+
simple: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare function createAnalyzeCommand(): Command;
|
|
15
|
+
export declare function runAnalyze(options: AnalyzeOptions): Promise<void>;
|
|
16
|
+
//# sourceMappingURL=analyze.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analyze.d.ts","sourceRoot":"","sources":["../../src/commands/analyze.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAuBpC,MAAM,WAAW,cAAc;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,OAAO,CAAC;IACf,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,wBAAgB,oBAAoB,IAAI,OAAO,CAkB9C;AAED,wBAAsB,UAAU,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CA0PvE"}
|