@boshu2/vibe-check 1.8.1 → 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/Makefile +4 -4
- 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.js +88 -129
- 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.js +54 -60
- 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 +2 -2
- package/dist/inner-loop/context-amnesia.d.ts.map +1 -1
- package/dist/inner-loop/context-amnesia.js +7 -10
- package/dist/inner-loop/context-amnesia.js.map +1 -1
- package/dist/inner-loop/index.d.ts +7 -7
- package/dist/inner-loop/index.d.ts.map +1 -1
- package/dist/inner-loop/index.js +18 -45
- package/dist/inner-loop/index.js.map +1 -1
- package/dist/inner-loop/instruction-drift.d.ts +2 -2
- package/dist/inner-loop/instruction-drift.d.ts.map +1 -1
- package/dist/inner-loop/instruction-drift.js +5 -10
- package/dist/inner-loop/instruction-drift.js.map +1 -1
- package/dist/inner-loop/logging-only.d.ts +2 -2
- package/dist/inner-loop/logging-only.d.ts.map +1 -1
- package/dist/inner-loop/logging-only.js +9 -17
- package/dist/inner-loop/logging-only.js.map +1 -1
- package/dist/inner-loop/tests-passing-lie.d.ts +2 -2
- package/dist/inner-loop/tests-passing-lie.d.ts.map +1 -1
- package/dist/inner-loop/tests-passing-lie.js +12 -17
- package/dist/inner-loop/tests-passing-lie.js.map +1 -1
- package/dist/inner-loop/types.js +1 -4
- package/dist/inner-loop/types.js.map +1 -1
- 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/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
|
@@ -1,55 +1,15 @@
|
|
|
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.getCommitLogPath = getCommitLogPath;
|
|
37
|
-
exports.appendCommits = appendCommits;
|
|
38
|
-
exports.readCommitLog = readCommitLog;
|
|
39
|
-
exports.getLastLoggedCommitHash = getLastLoggedCommitHash;
|
|
40
|
-
exports.getCommitLogCount = getCommitLogCount;
|
|
41
1
|
/**
|
|
42
2
|
* Append-only commit log using NDJSON format.
|
|
43
3
|
* This is the source of truth - timeline.json is derived from this.
|
|
44
4
|
*/
|
|
45
|
-
|
|
46
|
-
|
|
5
|
+
import * as path from 'path';
|
|
6
|
+
import { appendLineSync, readNdjsonSync } from './atomic.js';
|
|
47
7
|
const STORE_DIR = '.vibe-check';
|
|
48
8
|
const COMMIT_LOG_FILE = 'commits.ndjson';
|
|
49
9
|
/**
|
|
50
10
|
* Get commit log file path
|
|
51
11
|
*/
|
|
52
|
-
function getCommitLogPath(repoPath = process.cwd()) {
|
|
12
|
+
export function getCommitLogPath(repoPath = process.cwd()) {
|
|
53
13
|
return path.join(repoPath, STORE_DIR, COMMIT_LOG_FILE);
|
|
54
14
|
}
|
|
55
15
|
/**
|
|
@@ -82,15 +42,15 @@ function fromStoredCommit(stored) {
|
|
|
82
42
|
* Append new commits to the log.
|
|
83
43
|
* Skips commits that already exist (by hash).
|
|
84
44
|
*/
|
|
85
|
-
function appendCommits(commits, repoPath = process.cwd()) {
|
|
45
|
+
export function appendCommits(commits, repoPath = process.cwd()) {
|
|
86
46
|
const logPath = getCommitLogPath(repoPath);
|
|
87
47
|
// Load existing hashes to prevent duplicates
|
|
88
|
-
const existingHashes = new Set(
|
|
48
|
+
const existingHashes = new Set(readNdjsonSync(logPath).map(c => c.h));
|
|
89
49
|
let appendedCount = 0;
|
|
90
50
|
for (const commit of commits) {
|
|
91
51
|
if (!existingHashes.has(commit.hash)) {
|
|
92
52
|
const stored = toStoredCommit(commit);
|
|
93
|
-
|
|
53
|
+
appendLineSync(logPath, JSON.stringify(stored));
|
|
94
54
|
existingHashes.add(commit.hash);
|
|
95
55
|
appendedCount++;
|
|
96
56
|
}
|
|
@@ -100,16 +60,16 @@ function appendCommits(commits, repoPath = process.cwd()) {
|
|
|
100
60
|
/**
|
|
101
61
|
* Read all commits from the log.
|
|
102
62
|
*/
|
|
103
|
-
function readCommitLog(repoPath = process.cwd()) {
|
|
63
|
+
export function readCommitLog(repoPath = process.cwd()) {
|
|
104
64
|
const logPath = getCommitLogPath(repoPath);
|
|
105
|
-
const stored =
|
|
65
|
+
const stored = readNdjsonSync(logPath);
|
|
106
66
|
return stored.map(fromStoredCommit);
|
|
107
67
|
}
|
|
108
68
|
/**
|
|
109
69
|
* Get the most recent commit hash from the log.
|
|
110
70
|
* Returns empty string if log is empty.
|
|
111
71
|
*/
|
|
112
|
-
function getLastLoggedCommitHash(repoPath = process.cwd()) {
|
|
72
|
+
export function getLastLoggedCommitHash(repoPath = process.cwd()) {
|
|
113
73
|
const commits = readCommitLog(repoPath);
|
|
114
74
|
if (commits.length === 0)
|
|
115
75
|
return '';
|
|
@@ -120,9 +80,9 @@ function getLastLoggedCommitHash(repoPath = process.cwd()) {
|
|
|
120
80
|
/**
|
|
121
81
|
* Get commit count in the log.
|
|
122
82
|
*/
|
|
123
|
-
function getCommitLogCount(repoPath = process.cwd()) {
|
|
83
|
+
export function getCommitLogCount(repoPath = process.cwd()) {
|
|
124
84
|
const logPath = getCommitLogPath(repoPath);
|
|
125
|
-
const commits =
|
|
85
|
+
const commits = readNdjsonSync(logPath);
|
|
126
86
|
return commits.length;
|
|
127
87
|
}
|
|
128
88
|
//# sourceMappingURL=commit-log.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commit-log.js","sourceRoot":"","sources":["../../src/storage/commit-log.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"commit-log.js","sourceRoot":"","sources":["../../src/storage/commit-log.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7D,MAAM,SAAS,GAAG,aAAa,CAAC;AAChC,MAAM,eAAe,GAAG,gBAAgB,CAAC;AAczC;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,WAAmB,OAAO,CAAC,GAAG,EAAE;IAC/D,OAAO,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,SAAS,EAAE,eAAe,CAAC,CAAC;AACzD,CAAC;AAED;;GAEG;AACH,SAAS,cAAc,CAAC,MAAc;IACpC,OAAO;QACL,CAAC,EAAE,MAAM,CAAC,IAAI;QACd,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE;QAC5B,CAAC,EAAE,MAAM,CAAC,OAAO;QACjB,CAAC,EAAE,MAAM,CAAC,IAAI;QACd,CAAC,EAAE,MAAM,CAAC,KAAK;QACf,CAAC,EAAE,MAAM,CAAC,MAAM;KACjB,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,SAAS,gBAAgB,CAAC,MAAoB;IAC5C,OAAO;QACL,IAAI,EAAE,MAAM,CAAC,CAAC;QACd,IAAI,EAAE,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;QACxB,OAAO,EAAE,MAAM,CAAC,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC,CAAmB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xC,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAEpC,iDAAiD;IACjD,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;IAC3E,OAAO,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AACxB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAAC,WAAmB,OAAO,CAAC,GAAG,EAAE;IAChE,MAAM,OAAO,GAAG,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC3C,MAAM,OAAO,GAAG,cAAc,CAAe,OAAO,CAAC,CAAC;IACtD,OAAO,OAAO,CAAC,MAAM,CAAC;AACxB,CAAC"}
|
package/dist/storage/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { TimelineStore, StoredSession, StoredInsight, PatternStats, TrendData, WeekTrend, MonthTrend, loadStore, saveStore, createInitialStore, updateStore, getLastCommitHash, getStorePath, getStoreDir, } from './timeline-store';
|
|
2
|
-
export { atomicWriteSync, appendLineSync, readNdjsonSync, readNdjsonWithErrors, safeReadJsonSync, ensureGitignore, NdjsonReadResult, } from './atomic';
|
|
3
|
-
export { StoredCommit, getCommitLogPath, appendCommits, readCommitLog, getLastLoggedCommitHash, getCommitLogCount, } from './commit-log';
|
|
4
|
-
export { SchemaVersion, CURRENT_SCHEMA_VERSION, VersionedStore, migrateStore, needsMigration, } from './schema';
|
|
5
|
-
export { SpiralRecord, SpiralResolution, SpiralAdvice, getSpiralHistoryPath, appendSpiral, resolveSpiral, readSpiralHistory, getAdvice, getPatternStats, getPatternDisplayName, getResolutionDisplayName, } from './spiral-history';
|
|
1
|
+
export { TimelineStore, StoredSession, StoredInsight, PatternStats, TrendData, WeekTrend, MonthTrend, loadStore, saveStore, createInitialStore, updateStore, getLastCommitHash, getStorePath, getStoreDir, } from './timeline-store.js';
|
|
2
|
+
export { atomicWriteSync, appendLineSync, readNdjsonSync, readNdjsonWithErrors, safeReadJsonSync, ensureGitignore, NdjsonReadResult, } from './atomic.js';
|
|
3
|
+
export { StoredCommit, getCommitLogPath, appendCommits, readCommitLog, getLastLoggedCommitHash, getCommitLogCount, } from './commit-log.js';
|
|
4
|
+
export { SchemaVersion, CURRENT_SCHEMA_VERSION, VersionedStore, migrateStore, needsMigration, } from './schema.js';
|
|
5
|
+
export { SpiralRecord, SpiralResolution, SpiralAdvice, getSpiralHistoryPath, appendSpiral, resolveSpiral, readSpiralHistory, getAdvice, getPatternStats, getPatternDisplayName, getResolutionDisplayName, } from './spiral-history.js';
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/storage/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,aAAa,EACb,aAAa,EACb,aAAa,EACb,YAAY,EACZ,SAAS,EACT,SAAS,EACT,UAAU,EACV,SAAS,EACT,SAAS,EACT,kBAAkB,EAClB,WAAW,EACX,iBAAiB,EACjB,YAAY,EACZ,WAAW,GACZ,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/storage/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,aAAa,EACb,aAAa,EACb,aAAa,EACb,YAAY,EACZ,SAAS,EACT,SAAS,EACT,UAAU,EACV,SAAS,EACT,SAAS,EACT,kBAAkB,EAClB,WAAW,EACX,iBAAiB,EACjB,YAAY,EACZ,WAAW,GACZ,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EACL,eAAe,EACf,cAAc,EACd,cAAc,EACd,oBAAoB,EACpB,gBAAgB,EAChB,eAAe,EACf,gBAAgB,GACjB,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,uBAAuB,EACvB,iBAAiB,GAClB,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EACL,aAAa,EACb,sBAAsB,EACtB,cAAc,EACd,YAAY,EACZ,cAAc,GACf,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,oBAAoB,EACpB,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,SAAS,EACT,eAAe,EACf,qBAAqB,EACrB,wBAAwB,GACzB,MAAM,qBAAqB,CAAC"}
|
package/dist/storage/index.js
CHANGED
|
@@ -1,43 +1,11 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getResolutionDisplayName = exports.getPatternDisplayName = exports.getPatternStats = exports.getAdvice = exports.readSpiralHistory = exports.resolveSpiral = exports.appendSpiral = exports.getSpiralHistoryPath = exports.needsMigration = exports.migrateStore = exports.CURRENT_SCHEMA_VERSION = exports.getCommitLogCount = exports.getLastLoggedCommitHash = exports.readCommitLog = exports.appendCommits = exports.getCommitLogPath = exports.ensureGitignore = exports.safeReadJsonSync = exports.readNdjsonWithErrors = exports.readNdjsonSync = exports.appendLineSync = exports.atomicWriteSync = exports.getStoreDir = exports.getStorePath = exports.getLastCommitHash = exports.updateStore = exports.createInitialStore = exports.saveStore = exports.loadStore = void 0;
|
|
4
1
|
// Timeline store (computed view)
|
|
5
|
-
|
|
6
|
-
Object.defineProperty(exports, "loadStore", { enumerable: true, get: function () { return timeline_store_1.loadStore; } });
|
|
7
|
-
Object.defineProperty(exports, "saveStore", { enumerable: true, get: function () { return timeline_store_1.saveStore; } });
|
|
8
|
-
Object.defineProperty(exports, "createInitialStore", { enumerable: true, get: function () { return timeline_store_1.createInitialStore; } });
|
|
9
|
-
Object.defineProperty(exports, "updateStore", { enumerable: true, get: function () { return timeline_store_1.updateStore; } });
|
|
10
|
-
Object.defineProperty(exports, "getLastCommitHash", { enumerable: true, get: function () { return timeline_store_1.getLastCommitHash; } });
|
|
11
|
-
Object.defineProperty(exports, "getStorePath", { enumerable: true, get: function () { return timeline_store_1.getStorePath; } });
|
|
12
|
-
Object.defineProperty(exports, "getStoreDir", { enumerable: true, get: function () { return timeline_store_1.getStoreDir; } });
|
|
2
|
+
export { loadStore, saveStore, createInitialStore, updateStore, getLastCommitHash, getStorePath, getStoreDir, } from './timeline-store.js';
|
|
13
3
|
// Atomic file operations
|
|
14
|
-
|
|
15
|
-
Object.defineProperty(exports, "atomicWriteSync", { enumerable: true, get: function () { return atomic_1.atomicWriteSync; } });
|
|
16
|
-
Object.defineProperty(exports, "appendLineSync", { enumerable: true, get: function () { return atomic_1.appendLineSync; } });
|
|
17
|
-
Object.defineProperty(exports, "readNdjsonSync", { enumerable: true, get: function () { return atomic_1.readNdjsonSync; } });
|
|
18
|
-
Object.defineProperty(exports, "readNdjsonWithErrors", { enumerable: true, get: function () { return atomic_1.readNdjsonWithErrors; } });
|
|
19
|
-
Object.defineProperty(exports, "safeReadJsonSync", { enumerable: true, get: function () { return atomic_1.safeReadJsonSync; } });
|
|
20
|
-
Object.defineProperty(exports, "ensureGitignore", { enumerable: true, get: function () { return atomic_1.ensureGitignore; } });
|
|
4
|
+
export { atomicWriteSync, appendLineSync, readNdjsonSync, readNdjsonWithErrors, safeReadJsonSync, ensureGitignore, } from './atomic.js';
|
|
21
5
|
// Commit log (NDJSON source of truth)
|
|
22
|
-
|
|
23
|
-
Object.defineProperty(exports, "getCommitLogPath", { enumerable: true, get: function () { return commit_log_1.getCommitLogPath; } });
|
|
24
|
-
Object.defineProperty(exports, "appendCommits", { enumerable: true, get: function () { return commit_log_1.appendCommits; } });
|
|
25
|
-
Object.defineProperty(exports, "readCommitLog", { enumerable: true, get: function () { return commit_log_1.readCommitLog; } });
|
|
26
|
-
Object.defineProperty(exports, "getLastLoggedCommitHash", { enumerable: true, get: function () { return commit_log_1.getLastLoggedCommitHash; } });
|
|
27
|
-
Object.defineProperty(exports, "getCommitLogCount", { enumerable: true, get: function () { return commit_log_1.getCommitLogCount; } });
|
|
6
|
+
export { getCommitLogPath, appendCommits, readCommitLog, getLastLoggedCommitHash, getCommitLogCount, } from './commit-log.js';
|
|
28
7
|
// Schema versioning
|
|
29
|
-
|
|
30
|
-
Object.defineProperty(exports, "CURRENT_SCHEMA_VERSION", { enumerable: true, get: function () { return schema_1.CURRENT_SCHEMA_VERSION; } });
|
|
31
|
-
Object.defineProperty(exports, "migrateStore", { enumerable: true, get: function () { return schema_1.migrateStore; } });
|
|
32
|
-
Object.defineProperty(exports, "needsMigration", { enumerable: true, get: function () { return schema_1.needsMigration; } });
|
|
8
|
+
export { CURRENT_SCHEMA_VERSION, migrateStore, needsMigration, } from './schema.js';
|
|
33
9
|
// Spiral history (coaching feature)
|
|
34
|
-
|
|
35
|
-
Object.defineProperty(exports, "getSpiralHistoryPath", { enumerable: true, get: function () { return spiral_history_1.getSpiralHistoryPath; } });
|
|
36
|
-
Object.defineProperty(exports, "appendSpiral", { enumerable: true, get: function () { return spiral_history_1.appendSpiral; } });
|
|
37
|
-
Object.defineProperty(exports, "resolveSpiral", { enumerable: true, get: function () { return spiral_history_1.resolveSpiral; } });
|
|
38
|
-
Object.defineProperty(exports, "readSpiralHistory", { enumerable: true, get: function () { return spiral_history_1.readSpiralHistory; } });
|
|
39
|
-
Object.defineProperty(exports, "getAdvice", { enumerable: true, get: function () { return spiral_history_1.getAdvice; } });
|
|
40
|
-
Object.defineProperty(exports, "getPatternStats", { enumerable: true, get: function () { return spiral_history_1.getPatternStats; } });
|
|
41
|
-
Object.defineProperty(exports, "getPatternDisplayName", { enumerable: true, get: function () { return spiral_history_1.getPatternDisplayName; } });
|
|
42
|
-
Object.defineProperty(exports, "getResolutionDisplayName", { enumerable: true, get: function () { return spiral_history_1.getResolutionDisplayName; } });
|
|
10
|
+
export { getSpiralHistoryPath, appendSpiral, resolveSpiral, readSpiralHistory, getAdvice, getPatternStats, getPatternDisplayName, getResolutionDisplayName, } from './spiral-history.js';
|
|
43
11
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/storage/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/storage/index.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,OAAO,EAQL,SAAS,EACT,SAAS,EACT,kBAAkB,EAClB,WAAW,EACX,iBAAiB,EACjB,YAAY,EACZ,WAAW,GACZ,MAAM,qBAAqB,CAAC;AAE7B,yBAAyB;AACzB,OAAO,EACL,eAAe,EACf,cAAc,EACd,cAAc,EACd,oBAAoB,EACpB,gBAAgB,EAChB,eAAe,GAEhB,MAAM,aAAa,CAAC;AAErB,sCAAsC;AACtC,OAAO,EAEL,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,uBAAuB,EACvB,iBAAiB,GAClB,MAAM,iBAAiB,CAAC;AAEzB,oBAAoB;AACpB,OAAO,EAEL,sBAAsB,EAEtB,YAAY,EACZ,cAAc,GACf,MAAM,aAAa,CAAC;AAErB,oCAAoC;AACpC,OAAO,EAIL,oBAAoB,EACpB,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,SAAS,EACT,eAAe,EACf,qBAAqB,EACrB,wBAAwB,GACzB,MAAM,qBAAqB,CAAC"}
|
package/dist/storage/schema.js
CHANGED
|
@@ -1,16 +1,11 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* Schema versioning and migration utilities
|
|
4
3
|
*/
|
|
5
|
-
|
|
6
|
-
exports.CURRENT_SCHEMA_VERSION = void 0;
|
|
7
|
-
exports.migrateStore = migrateStore;
|
|
8
|
-
exports.needsMigration = needsMigration;
|
|
9
|
-
exports.CURRENT_SCHEMA_VERSION = '2.0.0';
|
|
4
|
+
export const CURRENT_SCHEMA_VERSION = '2.0.0';
|
|
10
5
|
/**
|
|
11
6
|
* Apply migrations to bring store to current version
|
|
12
7
|
*/
|
|
13
|
-
function migrateStore(store, migrations) {
|
|
8
|
+
export function migrateStore(store, migrations) {
|
|
14
9
|
let currentStore = store;
|
|
15
10
|
// Migration path
|
|
16
11
|
const migrationPath = [
|
|
@@ -31,7 +26,7 @@ function migrateStore(store, migrations) {
|
|
|
31
26
|
/**
|
|
32
27
|
* Check if store needs migration
|
|
33
28
|
*/
|
|
34
|
-
function needsMigration(store) {
|
|
35
|
-
return store.version !==
|
|
29
|
+
export function needsMigration(store) {
|
|
30
|
+
return store.version !== CURRENT_SCHEMA_VERSION;
|
|
36
31
|
}
|
|
37
32
|
//# sourceMappingURL=schema.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/storage/schema.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/storage/schema.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,MAAM,CAAC,MAAM,sBAAsB,GAAkB,OAAO,CAAC;AAuB7D;;GAEG;AACH,MAAM,UAAU,YAAY,CAC1B,KAAQ,EACR,UAAgC;IAEhC,IAAI,YAAY,GAAG,KAAK,CAAC;IAEzB,iBAAiB;IACjB,MAAM,aAAa,GAAsC;QACvD,gBAAgB;QAChB,gBAAgB;KACjB,CAAC;IAEF,KAAK,MAAM,YAAY,IAAI,aAAa,EAAE,CAAC;QACzC,MAAM,CAAC,WAAW,CAAC,GAAI,YAAuB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAE7D,IAAI,YAAY,CAAC,OAAO,KAAK,WAAW,EAAE,CAAC;YACzC,MAAM,SAAS,GAAG,UAAU,CAAC,YAAY,CAAC,CAAC;YAC3C,IAAI,SAAS,EAAE,CAAC;gBACd,YAAY,GAAG,SAAS,CAAC,YAAY,CAAC,CAAC;YACzC,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,YAAY,CAAC;AACtB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,KAAqB;IAClD,OAAO,KAAK,CAAC,OAAO,KAAK,sBAAsB,CAAC;AAClD,CAAC"}
|
|
@@ -1,68 +1,25 @@
|
|
|
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.getSpiralHistoryPath = getSpiralHistoryPath;
|
|
37
|
-
exports.appendSpiral = appendSpiral;
|
|
38
|
-
exports.resolveSpiral = resolveSpiral;
|
|
39
|
-
exports.readSpiralHistory = readSpiralHistory;
|
|
40
|
-
exports.getAdvice = getAdvice;
|
|
41
|
-
exports.getPatternStats = getPatternStats;
|
|
42
|
-
exports.getPatternDisplayName = getPatternDisplayName;
|
|
43
|
-
exports.getResolutionDisplayName = getResolutionDisplayName;
|
|
44
1
|
/**
|
|
45
2
|
* Spiral History Storage
|
|
46
3
|
*
|
|
47
4
|
* Append-only NDJSON log of spiral events with resolution tracking.
|
|
48
5
|
* Enables personalized coaching based on what worked before.
|
|
49
6
|
*/
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
7
|
+
import * as path from 'path';
|
|
8
|
+
import * as os from 'os';
|
|
9
|
+
import { appendLineSync, readNdjsonSync, atomicWriteSync } from './atomic.js';
|
|
53
10
|
const HISTORY_DIR = '.vibe-check';
|
|
54
11
|
const HISTORY_FILE = 'spiral-history.ndjson';
|
|
55
12
|
const MAX_RECORDS = 100; // Keep last 100 spirals
|
|
56
13
|
/**
|
|
57
14
|
* Get spiral history file path (in user's home directory)
|
|
58
15
|
*/
|
|
59
|
-
function getSpiralHistoryPath() {
|
|
16
|
+
export function getSpiralHistoryPath() {
|
|
60
17
|
return path.join(os.homedir(), HISTORY_DIR, HISTORY_FILE);
|
|
61
18
|
}
|
|
62
19
|
/**
|
|
63
20
|
* Append a spiral to history
|
|
64
21
|
*/
|
|
65
|
-
function appendSpiral(pattern, component, duration, commits) {
|
|
22
|
+
export function appendSpiral(pattern, component, duration, commits) {
|
|
66
23
|
const record = {
|
|
67
24
|
date: new Date().toISOString(),
|
|
68
25
|
pattern,
|
|
@@ -70,12 +27,12 @@ function appendSpiral(pattern, component, duration, commits) {
|
|
|
70
27
|
duration,
|
|
71
28
|
commits,
|
|
72
29
|
};
|
|
73
|
-
|
|
30
|
+
appendLineSync(getSpiralHistoryPath(), JSON.stringify(record));
|
|
74
31
|
}
|
|
75
32
|
/**
|
|
76
33
|
* Resolve the most recent unresolved spiral
|
|
77
34
|
*/
|
|
78
|
-
function resolveSpiral(resolution) {
|
|
35
|
+
export function resolveSpiral(resolution) {
|
|
79
36
|
const records = readSpiralHistory();
|
|
80
37
|
// Find most recent unresolved spiral
|
|
81
38
|
for (let i = records.length - 1; i >= 0; i--) {
|
|
@@ -92,13 +49,13 @@ function resolveSpiral(resolution) {
|
|
|
92
49
|
/**
|
|
93
50
|
* Read all spiral history
|
|
94
51
|
*/
|
|
95
|
-
function readSpiralHistory() {
|
|
96
|
-
return
|
|
52
|
+
export function readSpiralHistory() {
|
|
53
|
+
return readNdjsonSync(getSpiralHistoryPath());
|
|
97
54
|
}
|
|
98
55
|
/**
|
|
99
56
|
* Get personalized advice for a pattern
|
|
100
57
|
*/
|
|
101
|
-
function getAdvice(pattern, component) {
|
|
58
|
+
export function getAdvice(pattern, component) {
|
|
102
59
|
const records = readSpiralHistory();
|
|
103
60
|
// Filter to matching pattern (and optionally component)
|
|
104
61
|
const matching = records.filter((r) => r.pattern === pattern && (!component || r.component === component));
|
|
@@ -141,7 +98,7 @@ function getAdvice(pattern, component) {
|
|
|
141
98
|
/**
|
|
142
99
|
* Get pattern statistics for insights command
|
|
143
100
|
*/
|
|
144
|
-
function getPatternStats(days = 30) {
|
|
101
|
+
export function getPatternStats(days = 30) {
|
|
145
102
|
const records = readSpiralHistory();
|
|
146
103
|
const cutoff = new Date();
|
|
147
104
|
cutoff.setDate(cutoff.getDate() - days);
|
|
@@ -196,7 +153,7 @@ function rewriteHistory(records) {
|
|
|
196
153
|
// Write each record as a line
|
|
197
154
|
const content = trimmed.map((r) => JSON.stringify(r)).join('\n') + '\n';
|
|
198
155
|
// Use atomic write for safety
|
|
199
|
-
|
|
156
|
+
atomicWriteSync(filePath, content);
|
|
200
157
|
}
|
|
201
158
|
/**
|
|
202
159
|
* Generate actionable suggestion based on history
|
|
@@ -236,7 +193,7 @@ function generateSuggestion(pattern, whatWorked, totalTimes) {
|
|
|
236
193
|
/**
|
|
237
194
|
* Friendly pattern names for display
|
|
238
195
|
*/
|
|
239
|
-
function getPatternDisplayName(pattern) {
|
|
196
|
+
export function getPatternDisplayName(pattern) {
|
|
240
197
|
const names = {
|
|
241
198
|
SECRETS_AUTH: 'OAuth/Token Issues',
|
|
242
199
|
VOLUME_CONFIG: 'Volume/Mount Issues',
|
|
@@ -251,7 +208,7 @@ function getPatternDisplayName(pattern) {
|
|
|
251
208
|
/**
|
|
252
209
|
* Friendly resolution names for display
|
|
253
210
|
*/
|
|
254
|
-
function getResolutionDisplayName(resolution) {
|
|
211
|
+
export function getResolutionDisplayName(resolution) {
|
|
255
212
|
const names = {
|
|
256
213
|
TEST: 'Wrote a test',
|
|
257
214
|
BREAK: 'Took a break',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spiral-history.js","sourceRoot":"","sources":["../../src/storage/spiral-history.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"spiral-history.js","sourceRoot":"","sources":["../../src/storage/spiral-history.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AA+B9E,MAAM,WAAW,GAAG,aAAa,CAAC;AAClC,MAAM,YAAY,GAAG,uBAAuB,CAAC;AAC7C,MAAM,WAAW,GAAG,GAAG,CAAC,CAAC,wBAAwB;AAEjD;;GAEG;AACH,MAAM,UAAU,oBAAoB;IAClC,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,YAAY,CAAC,CAAC;AAC5D,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,YA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AAI,UAAU,KAAK,CAAC,EAAE,CAAC;QACrB,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,OAAO,mBAAmB,UAAU,MAAM,UAAU,EAAE,CAAC;AACzD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,qBAAqB,CAAC,OAAe;IACnD,MAAM,KAAK,GAA2B;QACpC,YAAY,EAAE,oBAAoB;QAClC,aAAa,EAAE,qBAAqB;QACpC,YAAY,EAAE,2BAA2B;QACzC,OAAO,EAAE,4BAA4B;QACrC,cAAc,EAAE,uBAAuB;QACvC,YAAY,EAAE,oBAAoB;QAClC,KAAK,EAAE,cAAc;KACtB,CAAC;IAEF,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,OAAO,CAAC;AACnC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,wBAAwB,CAAC,UAA4B;IACnE,MAAM,KAAK,GAAqC;QAC9C,IAAI,EAAE,cAAc;QACpB,KAAK,EAAE,cAAc;QACrB,IAAI,EAAE,eAAe;QACrB,IAAI,EAAE,gBAAgB;QACtB,QAAQ,EAAE,aAAa;QACvB,KAAK,EAAE,OAAO;KACf,CAAC;IAEF,OAAO,KAAK,CAAC,UAAU,CAAC,CAAC;AAC3B,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { TimelineResult, TimelineSession } from '../types';
|
|
2
|
-
import { SchemaVersion } from './schema';
|
|
1
|
+
import { TimelineResult, TimelineSession } from '../types.js';
|
|
2
|
+
import { SchemaVersion } from './schema.js';
|
|
3
3
|
export interface TimelineStore {
|
|
4
4
|
version: SchemaVersion;
|
|
5
5
|
lastUpdated: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timeline-store.d.ts","sourceRoot":"","sources":["../../src/storage/timeline-store.ts"],"names":[],"mappings":"AACA,OAAO,EACL,cAAc,EACd,eAAe,EAGhB,MAAM,
|
|
1
|
+
{"version":3,"file":"timeline-store.d.ts","sourceRoot":"","sources":["../../src/storage/timeline-store.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AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,QAAQ,GAAE,MAAsB,GAAG,MAAM,CAEpE;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,QAAQ,GAAE,MAAsB,GAAG,MAAM,CAErE;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,aAAa,CA4BlD;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,QAAQ,GAAE,MAAsB,GAAG,aAAa,CAQzE;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,aAAa,EAAE,QAAQ,GAAE,MAAsB,GAAG,IAAI,CAOtF;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,GAAE,MAAsB,GAAG,MAAM,CAG1E;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,EAAE,GAAG,OAAO,CAcnF;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,eAAe,GAAG,aAAa,CAiBvE;AAED;;GAEG;AACH,wBAAgB,WAAW,CACzB,KAAK,EAAE,aAAa,EACpB,QAAQ,EAAE,cAAc,EACxB,cAAc,EAAE,MAAM,GACrB,aAAa,CA4Bf"}
|
|
@@ -1,70 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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.getStoreDir = getStoreDir;
|
|
37
|
-
exports.getStorePath = getStorePath;
|
|
38
|
-
exports.createInitialStore = createInitialStore;
|
|
39
|
-
exports.loadStore = loadStore;
|
|
40
|
-
exports.saveStore = saveStore;
|
|
41
|
-
exports.getLastCommitHash = getLastCommitHash;
|
|
42
|
-
exports.sessionExists = sessionExists;
|
|
43
|
-
exports.sessionToStored = sessionToStored;
|
|
44
|
-
exports.updateStore = updateStore;
|
|
45
|
-
const path = __importStar(require("path"));
|
|
46
|
-
const atomic_1 = require("./atomic");
|
|
47
|
-
const schema_1 = require("./schema");
|
|
1
|
+
import * as path from 'path';
|
|
2
|
+
import { atomicWriteSync, safeReadJsonSync } from './atomic.js';
|
|
3
|
+
import { CURRENT_SCHEMA_VERSION } from './schema.js';
|
|
48
4
|
const STORE_DIR = '.vibe-check';
|
|
49
5
|
const TIMELINE_FILE = 'timeline.json';
|
|
50
6
|
/**
|
|
51
7
|
* Get store directory path (repo-local)
|
|
52
8
|
*/
|
|
53
|
-
function getStoreDir(repoPath = process.cwd()) {
|
|
9
|
+
export function getStoreDir(repoPath = process.cwd()) {
|
|
54
10
|
return path.join(repoPath, STORE_DIR);
|
|
55
11
|
}
|
|
56
12
|
/**
|
|
57
13
|
* Get timeline store file path
|
|
58
14
|
*/
|
|
59
|
-
function getStorePath(repoPath = process.cwd()) {
|
|
15
|
+
export function getStorePath(repoPath = process.cwd()) {
|
|
60
16
|
return path.join(getStoreDir(repoPath), TIMELINE_FILE);
|
|
61
17
|
}
|
|
62
18
|
/**
|
|
63
19
|
* Create initial empty store
|
|
64
20
|
*/
|
|
65
|
-
function createInitialStore() {
|
|
21
|
+
export function createInitialStore() {
|
|
66
22
|
return {
|
|
67
|
-
version:
|
|
23
|
+
version: CURRENT_SCHEMA_VERSION,
|
|
68
24
|
lastUpdated: new Date().toISOString(),
|
|
69
25
|
lastCommitHash: '',
|
|
70
26
|
sessions: [],
|
|
@@ -94,33 +50,33 @@ function createInitialStore() {
|
|
|
94
50
|
/**
|
|
95
51
|
* Load timeline store from disk
|
|
96
52
|
*/
|
|
97
|
-
function loadStore(repoPath = process.cwd()) {
|
|
53
|
+
export function loadStore(repoPath = process.cwd()) {
|
|
98
54
|
const filePath = getStorePath(repoPath);
|
|
99
55
|
const initialStore = createInitialStore();
|
|
100
|
-
const store =
|
|
56
|
+
const store = safeReadJsonSync(filePath, initialStore);
|
|
101
57
|
// Always migrate (handles both old versions and fresh stores)
|
|
102
58
|
return migrateTimelineStore(store);
|
|
103
59
|
}
|
|
104
60
|
/**
|
|
105
61
|
* Save timeline store to disk
|
|
106
62
|
*/
|
|
107
|
-
function saveStore(store, repoPath = process.cwd()) {
|
|
63
|
+
export function saveStore(store, repoPath = process.cwd()) {
|
|
108
64
|
const filePath = getStorePath(repoPath);
|
|
109
65
|
store.lastUpdated = new Date().toISOString();
|
|
110
66
|
// Use atomic write to prevent corruption
|
|
111
|
-
|
|
67
|
+
atomicWriteSync(filePath, JSON.stringify(store, null, 2));
|
|
112
68
|
}
|
|
113
69
|
/**
|
|
114
70
|
* Get last known commit hash for incremental sync
|
|
115
71
|
*/
|
|
116
|
-
function getLastCommitHash(repoPath = process.cwd()) {
|
|
72
|
+
export function getLastCommitHash(repoPath = process.cwd()) {
|
|
117
73
|
const store = loadStore(repoPath);
|
|
118
74
|
return store.lastCommitHash;
|
|
119
75
|
}
|
|
120
76
|
/**
|
|
121
77
|
* Check if a session already exists (by commit hashes)
|
|
122
78
|
*/
|
|
123
|
-
function sessionExists(store, commitHashes) {
|
|
79
|
+
export function sessionExists(store, commitHashes) {
|
|
124
80
|
const hashSet = new Set(commitHashes);
|
|
125
81
|
for (const session of store.sessions) {
|
|
126
82
|
// Check for significant overlap (>80% of commits match)
|
|
@@ -135,7 +91,7 @@ function sessionExists(store, commitHashes) {
|
|
|
135
91
|
/**
|
|
136
92
|
* Convert TimelineSession to StoredSession for persistence
|
|
137
93
|
*/
|
|
138
|
-
function sessionToStored(session) {
|
|
94
|
+
export function sessionToStored(session) {
|
|
139
95
|
return {
|
|
140
96
|
id: session.id,
|
|
141
97
|
date: session.start.toISOString().split('T')[0],
|
|
@@ -156,7 +112,7 @@ function sessionToStored(session) {
|
|
|
156
112
|
/**
|
|
157
113
|
* Update store with new timeline data
|
|
158
114
|
*/
|
|
159
|
-
function updateStore(store, timeline, lastCommitHash) {
|
|
115
|
+
export function updateStore(store, timeline, lastCommitHash) {
|
|
160
116
|
// Add new sessions (skip duplicates)
|
|
161
117
|
for (const session of timeline.sessions) {
|
|
162
118
|
const commitHashes = session.commits.map(c => c.hash);
|
|
@@ -420,7 +376,7 @@ function migrateTimelineStore(store) {
|
|
|
420
376
|
// Handle missing or old versions
|
|
421
377
|
if (!store.version || store.version === '1.0.0') {
|
|
422
378
|
// Migrate from 1.0.0 to current
|
|
423
|
-
store.version =
|
|
379
|
+
store.version = CURRENT_SCHEMA_VERSION;
|
|
424
380
|
}
|
|
425
381
|
if (!store.insights) {
|
|
426
382
|
store.insights = [];
|
|
@@ -432,7 +388,7 @@ function migrateTimelineStore(store) {
|
|
|
432
388
|
store.trends = createInitialStore().trends;
|
|
433
389
|
}
|
|
434
390
|
// Ensure version is current after all migrations
|
|
435
|
-
store.version =
|
|
391
|
+
store.version = CURRENT_SCHEMA_VERSION;
|
|
436
392
|
return store;
|
|
437
393
|
}
|
|
438
394
|
//# sourceMappingURL=timeline-store.js.map
|