@boshu2/vibe-check 1.8.1 → 2.2.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/plans/2025-12-27-vibe-check-evolution-plan.md +383 -0
- package/.agents/research/2025-12-27-vibe-check-evolution.md +352 -0
- package/.claude/settings.local.json +9 -3
- package/CHANGELOG.md +43 -0
- package/CLAUDE.md +201 -26
- package/Makefile +4 -4
- package/README.md +95 -0
- 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/eldritch.d.ts +40 -0
- package/dist/analyzers/eldritch.d.ts.map +1 -0
- package/dist/analyzers/eldritch.js +202 -0
- package/dist/analyzers/eldritch.js.map +1 -0
- package/dist/analyzers/modularity.d.ts +67 -0
- package/dist/analyzers/modularity.d.ts.map +1 -0
- package/dist/analyzers/modularity.js +254 -0
- package/dist/analyzers/modularity.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 +21 -20
- package/dist/cli.js.map +1 -1
- package/dist/commands/analyze.d.ts.map +1 -1
- package/dist/commands/analyze.js +124 -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 +102 -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 +10 -2
- package/dist/commands/forensics.d.ts.map +1 -1
- package/dist/commands/forensics.js +91 -51
- package/dist/commands/forensics.js.map +1 -1
- package/dist/commands/index.d.ts +15 -13
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/commands/index.js +15 -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/modularity.d.ts +27 -0
- package/dist/commands/modularity.d.ts.map +1 -0
- package/dist/commands/modularity.js +182 -0
- package/dist/commands/modularity.js.map +1 -0
- 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 +23 -29
- 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/cohesion.d.ts +27 -0
- package/dist/metrics/cohesion.d.ts.map +1 -0
- package/dist/metrics/cohesion.js +134 -0
- package/dist/metrics/cohesion.js.map +1 -0
- 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 +10 -2
- package/dist/metrics/index.d.ts.map +1 -1
- package/dist/metrics/index.js +51 -20
- package/dist/metrics/index.js.map +1 -1
- package/dist/metrics/investigation.d.ts +25 -0
- package/dist/metrics/investigation.d.ts.map +1 -0
- package/dist/metrics/investigation.js +115 -0
- package/dist/metrics/investigation.js.map +1 -0
- 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/tracers.d.ts +28 -0
- package/dist/metrics/tracers.d.ts.map +1 -0
- package/dist/metrics/tracers.js +117 -0
- package/dist/metrics/tracers.js.map +1 -0
- 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 +88 -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.d.ts +36 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +1 -2
- package/docs/ENHANCEMENT-PLAN.md +379 -0
- package/feature-list.json +6 -0
- package/package.json +8 -7
- package/.claude/skills/typescript-review.md +0 -152
- package/dist/calibration/ece.d.ts +0 -26
- package/dist/calibration/ece.d.ts.map +0 -1
- package/dist/calibration/ece.js +0 -93
- package/dist/calibration/ece.js.map +0 -1
- package/dist/calibration/index.d.ts +0 -3
- package/dist/calibration/index.d.ts.map +0 -1
- package/dist/calibration/index.js +0 -15
- package/dist/calibration/index.js.map +0 -1
- package/dist/calibration/storage.d.ts +0 -34
- package/dist/calibration/storage.d.ts.map +0 -1
- package/dist/calibration/storage.js +0 -188
- package/dist/calibration/storage.js.map +0 -1
- package/dist/commands/intervene.d.ts +0 -15
- package/dist/commands/intervene.d.ts.map +0 -1
- package/dist/commands/intervene.js +0 -183
- package/dist/commands/intervene.js.map +0 -1
- package/dist/commands/learn.d.ts +0 -3
- package/dist/commands/learn.d.ts.map +0 -1
- package/dist/commands/learn.js +0 -161
- package/dist/commands/learn.js.map +0 -1
- package/dist/commands/lesson.d.ts +0 -8
- package/dist/commands/lesson.d.ts.map +0 -1
- package/dist/commands/lesson.js +0 -206
- package/dist/commands/lesson.js.map +0 -1
- package/dist/commands/level.d.ts +0 -3
- package/dist/commands/level.d.ts.map +0 -1
- package/dist/commands/level.js +0 -277
- package/dist/commands/level.js.map +0 -1
- package/dist/gamification/badges.d.ts +0 -29
- package/dist/gamification/badges.d.ts.map +0 -1
- package/dist/gamification/badges.js +0 -114
- package/dist/gamification/badges.js.map +0 -1
- package/dist/gamification/challenges.d.ts +0 -42
- package/dist/gamification/challenges.d.ts.map +0 -1
- package/dist/gamification/challenges.js +0 -184
- package/dist/gamification/challenges.js.map +0 -1
- package/dist/gamification/hall-of-fame.d.ts +0 -17
- package/dist/gamification/hall-of-fame.d.ts.map +0 -1
- package/dist/gamification/hall-of-fame.js +0 -64
- package/dist/gamification/hall-of-fame.js.map +0 -1
- package/dist/gamification/intervention-memory.d.ts +0 -61
- package/dist/gamification/intervention-memory.d.ts.map +0 -1
- package/dist/gamification/intervention-memory.js +0 -229
- package/dist/gamification/intervention-memory.js.map +0 -1
- package/dist/gamification/leaderboards.d.ts +0 -49
- package/dist/gamification/leaderboards.d.ts.map +0 -1
- package/dist/gamification/leaderboards.js +0 -179
- package/dist/gamification/leaderboards.js.map +0 -1
- package/dist/gamification/pattern-memory.d.ts +0 -45
- package/dist/gamification/pattern-memory.d.ts.map +0 -1
- package/dist/gamification/pattern-memory.js +0 -188
- package/dist/gamification/pattern-memory.js.map +0 -1
- package/dist/gamification/share.d.ts +0 -29
- package/dist/gamification/share.d.ts.map +0 -1
- package/dist/gamification/share.js +0 -57
- package/dist/gamification/share.js.map +0 -1
- package/dist/learning/cadence.d.ts +0 -15
- package/dist/learning/cadence.d.ts.map +0 -1
- package/dist/learning/cadence.js +0 -130
- package/dist/learning/cadence.js.map +0 -1
- package/dist/learning/index.d.ts +0 -19
- package/dist/learning/index.d.ts.map +0 -1
- package/dist/learning/index.js +0 -35
- package/dist/learning/index.js.map +0 -1
- package/dist/learning/lessons-storage.d.ts +0 -48
- package/dist/learning/lessons-storage.d.ts.map +0 -1
- package/dist/learning/lessons-storage.js +0 -266
- package/dist/learning/lessons-storage.js.map +0 -1
- package/dist/learning/lessons-types.d.ts +0 -83
- package/dist/learning/lessons-types.d.ts.map +0 -1
- package/dist/learning/lessons-types.js +0 -15
- package/dist/learning/lessons-types.js.map +0 -1
- package/dist/learning/nudges.d.ts +0 -20
- package/dist/learning/nudges.d.ts.map +0 -1
- package/dist/learning/nudges.js +0 -68
- package/dist/learning/nudges.js.map +0 -1
- package/dist/learning/retrospective.d.ts +0 -27
- package/dist/learning/retrospective.d.ts.map +0 -1
- package/dist/learning/retrospective.js +0 -184
- package/dist/learning/retrospective.js.map +0 -1
- package/dist/learning/storage.d.ts +0 -44
- package/dist/learning/storage.d.ts.map +0 -1
- package/dist/learning/storage.js +0 -194
- package/dist/learning/storage.js.map +0 -1
- package/dist/learning/surfacing.d.ts +0 -36
- package/dist/learning/surfacing.d.ts.map +0 -1
- package/dist/learning/surfacing.js +0 -255
- package/dist/learning/surfacing.js.map +0 -1
- package/dist/learning/synthesis.d.ts +0 -17
- package/dist/learning/synthesis.d.ts.map +0 -1
- package/dist/learning/synthesis.js +0 -293
- package/dist/learning/synthesis.js.map +0 -1
- package/dist/learning/types.d.ts +0 -60
- package/dist/learning/types.d.ts.map +0 -1
- package/dist/learning/types.js +0 -17
- package/dist/learning/types.js.map +0 -1
- package/dist/recommend/index.d.ts +0 -3
- package/dist/recommend/index.d.ts.map +0 -1
- package/dist/recommend/index.js +0 -14
- package/dist/recommend/index.js.map +0 -1
- package/dist/recommend/ordered-logistic.d.ts +0 -49
- package/dist/recommend/ordered-logistic.d.ts.map +0 -1
- package/dist/recommend/ordered-logistic.js +0 -153
- package/dist/recommend/ordered-logistic.js.map +0 -1
- package/dist/recommend/questions.d.ts +0 -19
- package/dist/recommend/questions.d.ts.map +0 -1
- package/dist/recommend/questions.js +0 -73
- package/dist/recommend/questions.js.map +0 -1
package/dist/learning/cadence.js
DELETED
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Learning Cadence Scheduler
|
|
4
|
-
*
|
|
5
|
-
* Checks time-based and event-based triggers to generate nudges
|
|
6
|
-
* and determine when retrospectives are due.
|
|
7
|
-
*/
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.runLearningCadence = runLearningCadence;
|
|
10
|
-
const types_1 = require("./types");
|
|
11
|
-
const storage_1 = require("./storage");
|
|
12
|
-
const pattern_memory_1 = require("../gamification/pattern-memory");
|
|
13
|
-
/**
|
|
14
|
-
* Run learning cadence check after a session
|
|
15
|
-
*
|
|
16
|
-
* Called from recordSession() to check all triggers and generate nudges.
|
|
17
|
-
*/
|
|
18
|
-
function runLearningCadence(patternMemory, streakCurrent, xpToNextLevel, totalXp) {
|
|
19
|
-
const state = (0, storage_1.loadLearningState)();
|
|
20
|
-
const today = new Date().toISOString().split('T')[0];
|
|
21
|
-
let updatedState = { ...state };
|
|
22
|
-
// 1. Check daily trigger (first session of day)
|
|
23
|
-
if (state.lastDailyCheck !== today) {
|
|
24
|
-
updatedState.lastDailyCheck = today;
|
|
25
|
-
// Could add daily summary nudge here if desired
|
|
26
|
-
}
|
|
27
|
-
// 2. Check weekly retro trigger
|
|
28
|
-
const daysSinceRetro = getDaysSince(state.lastWeeklyRetro);
|
|
29
|
-
if (daysSinceRetro >= types_1.RETRO_CADENCE_DAYS) {
|
|
30
|
-
updatedState.retroDue = true;
|
|
31
|
-
updatedState.retroDueReason = `${daysSinceRetro} days since last retrospective`;
|
|
32
|
-
}
|
|
33
|
-
// 3. Check pattern repeat threshold
|
|
34
|
-
const repeatedPattern = getRepeatedPattern(patternMemory);
|
|
35
|
-
if (repeatedPattern) {
|
|
36
|
-
const displayName = (0, pattern_memory_1.getPatternDisplayName)(repeatedPattern.pattern);
|
|
37
|
-
updatedState = (0, storage_1.addNudge)(updatedState, {
|
|
38
|
-
type: 'pattern',
|
|
39
|
-
icon: '⚠️',
|
|
40
|
-
title: `${displayName} Pattern Detected`,
|
|
41
|
-
message: `${displayName} caused ${repeatedPattern.count} spirals this week (${repeatedPattern.totalMinutes} min)`,
|
|
42
|
-
action: 'Try a tracer test to validate assumptions',
|
|
43
|
-
priority: 8,
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
// 4. Check achievement proximity (within 20% of next level)
|
|
47
|
-
const xpProgress = xpToNextLevel > 0 ? (totalXp % xpToNextLevel) / xpToNextLevel : 0;
|
|
48
|
-
if (xpProgress >= 0.8) {
|
|
49
|
-
const xpNeeded = Math.round(xpToNextLevel * (1 - xpProgress));
|
|
50
|
-
updatedState = (0, storage_1.addNudge)(updatedState, {
|
|
51
|
-
type: 'achievement',
|
|
52
|
-
icon: '📈',
|
|
53
|
-
title: 'Level Up Soon!',
|
|
54
|
-
message: `Only ${xpNeeded} XP to your next level`,
|
|
55
|
-
priority: 5,
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
// 5. Check streak milestone proximity
|
|
59
|
-
if (streakCurrent > 0 && streakCurrent % 7 === 6) {
|
|
60
|
-
updatedState = (0, storage_1.addNudge)(updatedState, {
|
|
61
|
-
type: 'achievement',
|
|
62
|
-
icon: '🔥',
|
|
63
|
-
title: 'Streak Milestone Tomorrow!',
|
|
64
|
-
message: `One more day for a ${streakCurrent + 1}-day streak`,
|
|
65
|
-
priority: 6,
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
// 6. Add retro nudge if due
|
|
69
|
-
if (updatedState.retroDue) {
|
|
70
|
-
updatedState = (0, storage_1.addNudge)(updatedState, {
|
|
71
|
-
type: 'retro',
|
|
72
|
-
icon: '📅',
|
|
73
|
-
title: 'Weekly Retro Due',
|
|
74
|
-
message: updatedState.retroDueReason,
|
|
75
|
-
action: 'Run `vibe-check learn --retro` to review your week',
|
|
76
|
-
priority: 7,
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
// Save updated state
|
|
80
|
-
(0, storage_1.saveLearningState)(updatedState);
|
|
81
|
-
return {
|
|
82
|
-
nudges: updatedState.pendingNudges.filter(n => !n.dismissed),
|
|
83
|
-
retroDue: updatedState.retroDue,
|
|
84
|
-
retroDueReason: updatedState.retroDueReason,
|
|
85
|
-
learningState: updatedState,
|
|
86
|
-
};
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Get days since a date string
|
|
90
|
-
*/
|
|
91
|
-
function getDaysSince(dateStr) {
|
|
92
|
-
if (!dateStr)
|
|
93
|
-
return types_1.RETRO_CADENCE_DAYS + 1; // Force retro if no date
|
|
94
|
-
const date = new Date(dateStr);
|
|
95
|
-
const now = new Date();
|
|
96
|
-
return Math.floor((now.getTime() - date.getTime()) / (1000 * 60 * 60 * 24));
|
|
97
|
-
}
|
|
98
|
-
/**
|
|
99
|
-
* Check if any pattern has repeated >= threshold times in the window
|
|
100
|
-
*/
|
|
101
|
-
function getRepeatedPattern(patternMemory) {
|
|
102
|
-
if (!patternMemory || patternMemory.records.length === 0) {
|
|
103
|
-
return null;
|
|
104
|
-
}
|
|
105
|
-
const cutoff = new Date();
|
|
106
|
-
cutoff.setDate(cutoff.getDate() - types_1.PATTERN_WINDOW_DAYS);
|
|
107
|
-
const cutoffStr = cutoff.toISOString().split('T')[0];
|
|
108
|
-
// Count patterns in the window
|
|
109
|
-
const recentRecords = patternMemory.records.filter(r => r.date >= cutoffStr);
|
|
110
|
-
const patternCounts = new Map();
|
|
111
|
-
for (const record of recentRecords) {
|
|
112
|
-
const current = patternCounts.get(record.pattern) || { count: 0, minutes: 0 };
|
|
113
|
-
patternCounts.set(record.pattern, {
|
|
114
|
-
count: current.count + 1,
|
|
115
|
-
minutes: current.minutes + record.duration,
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
// Find first pattern exceeding threshold
|
|
119
|
-
for (const [pattern, data] of patternCounts) {
|
|
120
|
-
if (data.count >= types_1.PATTERN_REPEAT_THRESHOLD) {
|
|
121
|
-
return {
|
|
122
|
-
pattern,
|
|
123
|
-
count: data.count,
|
|
124
|
-
totalMinutes: data.minutes,
|
|
125
|
-
};
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
return null;
|
|
129
|
-
}
|
|
130
|
-
//# sourceMappingURL=cadence.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cadence.js","sourceRoot":"","sources":["../../src/learning/cadence.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAmBH,gDAmFC;AApGD,mCAOiB;AACjB,uCAA2E;AAE3E,mEAAuE;AAEvE;;;;GAIG;AACH,SAAgB,kBAAkB,CAChC,aAAwC,EACxC,aAAqB,EACrB,aAAqB,EACrB,OAAe;IAEf,MAAM,KAAK,GAAG,IAAA,2BAAiB,GAAE,CAAC;IAClC,MAAM,KAAK,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IACrD,IAAI,YAAY,GAAG,EAAE,GAAG,KAAK,EAAE,CAAC;IAEhC,gDAAgD;IAChD,IAAI,KAAK,CAAC,cAAc,KAAK,KAAK,EAAE,CAAC;QACnC,YAAY,CAAC,cAAc,GAAG,KAAK,CAAC;QACpC,gDAAgD;IAClD,CAAC;IAED,gCAAgC;IAChC,MAAM,cAAc,GAAG,YAAY,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;IAC3D,IAAI,cAAc,IAAI,0BAAkB,EAAE,CAAC;QACzC,YAAY,CAAC,QAAQ,GAAG,IAAI,CAAC;QAC7B,YAAY,CAAC,cAAc,GAAG,GAAG,cAAc,gCAAgC,CAAC;IAClF,CAAC;IAED,oCAAoC;IAC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ence for vibe-check
|
|
3
|
-
*
|
|
4
|
-
* This module provides:
|
|
5
|
-
* - Cadence-based triggers for learning
|
|
6
|
-
* - Nudge generation and display
|
|
7
|
-
* - Weekly retrospectives
|
|
8
|
-
* - Lessons database with synthesis and surfacing
|
|
9
|
-
*/
|
|
10
|
-
export * from './types';
|
|
11
|
-
export * from './storage';
|
|
12
|
-
export * from './cadence';
|
|
13
|
-
export * from './nudges';
|
|
14
|
-
export * from './retrospective';
|
|
15
|
-
export * from './lessons-types';
|
|
16
|
-
export * from './lessons-storage';
|
|
17
|
-
export * from './synthesis';
|
|
18
|
-
export * from './surfacing';
|
|
19
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/learning/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC"}
|
package/dist/learning/index.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Learning System - Automatic learning cadence for vibe-check
|
|
4
|
-
*
|
|
5
|
-
* This module provides:
|
|
6
|
-
* - Cadence-based triggers for learning
|
|
7
|
-
* - Nudge generation and display
|
|
8
|
-
* - Weekly retrospectives
|
|
9
|
-
* - Lessons database with synthesis and surfacing
|
|
10
|
-
*/
|
|
11
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
12
|
-
if (k2 === undefined) k2 = k;
|
|
13
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
14
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
15
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
16
|
-
}
|
|
17
|
-
Object.defineProperty(o, k2, desc);
|
|
18
|
-
}) : (function(o, m, k, k2) {
|
|
19
|
-
if (k2 === undefined) k2 = k;
|
|
20
|
-
o[k2] = m[k];
|
|
21
|
-
}));
|
|
22
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
23
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
__exportStar(require("./types"), exports);
|
|
27
|
-
__exportStar(require("./storage"), exports);
|
|
28
|
-
__exportStar(require("./cadence"), exports);
|
|
29
|
-
__exportStar(require("./nudges"), exports);
|
|
30
|
-
__exportStar(require("./retrospective"), exports);
|
|
31
|
-
__exportStar(require("./lessons-types"), exports);
|
|
32
|
-
__exportStar(require("./lessons-storage"), exports);
|
|
33
|
-
__exportStar(require("./synthesis"), exports);
|
|
34
|
-
__exportStar(require("./surfacing"), exports);
|
|
35
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/learning/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;;;;;;;;;;;;;;AAEH,0CAAwB;AACxB,4CAA0B;AAC1B,4CAA0B;AAC1B,2CAAyB;AACzB,kDAAgC;AAChC,kDAAgC;AAChC,oDAAkC;AAClC,8CAA4B;AAC5B,8CAA4B"}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Lessons Database Storage
|
|
3
|
-
*
|
|
4
|
-
* Persists lessons to ~/.vibe-check/lessons.json (global, not per-repo).
|
|
5
|
-
* Lessons are meant to accumulate across all repositories.
|
|
6
|
-
*/
|
|
7
|
-
import { LessonsDatabase, Lesson } from './lessons-types';
|
|
8
|
-
/**
|
|
9
|
-
* Get lessons database file path (global)
|
|
10
|
-
*/
|
|
11
|
-
export declare function getLessonsPath(): string;
|
|
12
|
-
/**
|
|
13
|
-
* Create initial empty lessons database
|
|
14
|
-
*/
|
|
15
|
-
export declare function createInitialLessonsDatabase(): LessonsDatabase;
|
|
16
|
-
/**
|
|
17
|
-
* Load lessons database from disk
|
|
18
|
-
*/
|
|
19
|
-
export declare function loadLessons(): LessonsDatabase;
|
|
20
|
-
/**
|
|
21
|
-
* Save lessons database to disk
|
|
22
|
-
*/
|
|
23
|
-
export declare function saveLessons(db: LessonsDatabase): void;
|
|
24
|
-
/**
|
|
25
|
-
* Add or update a lesson in the database
|
|
26
|
-
*/
|
|
27
|
-
export declare function upsertLesson(db: LessonsDatabase, lesson: Lesson): LessonsDatabase;
|
|
28
|
-
/**
|
|
29
|
-
* Get lesson by ID
|
|
30
|
-
*/
|
|
31
|
-
export declare function getLessonById(db: LessonsDatabase, id: string): Lesson | undefined;
|
|
32
|
-
/**
|
|
33
|
-
* Get lessons for a pattern
|
|
34
|
-
*/
|
|
35
|
-
export declare function getLessonsForPattern(db: LessonsDatabase, pattern: string): Lesson[];
|
|
36
|
-
/**
|
|
37
|
-
* Get all active (non-dismissed) lessons
|
|
38
|
-
*/
|
|
39
|
-
export declare function getActiveLessons(db: LessonsDatabase): Lesson[];
|
|
40
|
-
/**
|
|
41
|
-
* Dismiss a lesson
|
|
42
|
-
*/
|
|
43
|
-
export declare function dismissLesson(db: LessonsDatabase, lessonId: string): LessonsDatabase;
|
|
44
|
-
/**
|
|
45
|
-
* Mark a lesson as applied with effectiveness score
|
|
46
|
-
*/
|
|
47
|
-
export declare function applyLesson(db: LessonsDatabase, lessonId: string, effectiveness: number): LessonsDatabase;
|
|
48
|
-
//# sourceMappingURL=lessons-storage.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"lessons-storage.d.ts","sourceRoot":"","sources":["../../src/learning/lessons-storage.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,EACL,eAAe,EACf,MAAM,EAGP,MAAM,iBAAiB,CAAC;AAKzB;;GAEG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAEvC;AAED;;GAEG;AACH,wBAAgB,4BAA4B,IAAI,eAAe,CAiB9D;AAED;;GAEG;AACH,wBAAgB,WAAW,IAAI,eAAe,CAc7C;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,EAAE,EAAE,eAAe,GAAG,IAAI,CAqBrD;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,EAAE,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,GAAG,eAAe,CAmBjF;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,EAAE,EAAE,eAAe,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAEjF;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,EAAE,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAKnF;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,eAAe,GAAG,MAAM,EAAE,CAE9D;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,EAAE,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,GAAG,eAAe,CAOpF;AAED;;GAEG;AACH,wBAAgB,WAAW,CACzB,EAAE,EAAE,eAAe,EACnB,QAAQ,EAAE,MAAM,EAChB,aAAa,EAAE,MAAM,GACpB,eAAe,CAgBjB"}
|
|
@@ -1,266 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Lessons Database Storage
|
|
4
|
-
*
|
|
5
|
-
* Persists lessons to ~/.vibe-check/lessons.json (global, not per-repo).
|
|
6
|
-
* Lessons are meant to accumulate across all repositories.
|
|
7
|
-
*/
|
|
8
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
9
|
-
if (k2 === undefined) k2 = k;
|
|
10
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
11
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
12
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
13
|
-
}
|
|
14
|
-
Object.defineProperty(o, k2, desc);
|
|
15
|
-
}) : (function(o, m, k, k2) {
|
|
16
|
-
if (k2 === undefined) k2 = k;
|
|
17
|
-
o[k2] = m[k];
|
|
18
|
-
}));
|
|
19
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
20
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
21
|
-
}) : function(o, v) {
|
|
22
|
-
o["default"] = v;
|
|
23
|
-
});
|
|
24
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
25
|
-
var ownKeys = function(o) {
|
|
26
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
27
|
-
var ar = [];
|
|
28
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
29
|
-
return ar;
|
|
30
|
-
};
|
|
31
|
-
return ownKeys(o);
|
|
32
|
-
};
|
|
33
|
-
return function (mod) {
|
|
34
|
-
if (mod && mod.__esModule) return mod;
|
|
35
|
-
var result = {};
|
|
36
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
37
|
-
__setModuleDefault(result, mod);
|
|
38
|
-
return result;
|
|
39
|
-
};
|
|
40
|
-
})();
|
|
41
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
-
exports.getLessonsPath = getLessonsPath;
|
|
43
|
-
exports.createInitialLessonsDatabase = createInitialLessonsDatabase;
|
|
44
|
-
exports.loadLessons = loadLessons;
|
|
45
|
-
exports.saveLessons = saveLessons;
|
|
46
|
-
exports.upsertLesson = upsertLesson;
|
|
47
|
-
exports.getLessonById = getLessonById;
|
|
48
|
-
exports.getLessonsForPattern = getLessonsForPattern;
|
|
49
|
-
exports.getActiveLessons = getActiveLessons;
|
|
50
|
-
exports.dismissLesson = dismissLesson;
|
|
51
|
-
exports.applyLesson = applyLesson;
|
|
52
|
-
const fs = __importStar(require("fs"));
|
|
53
|
-
const path = __importStar(require("path"));
|
|
54
|
-
const os = __importStar(require("os"));
|
|
55
|
-
const lessons_types_1 = require("./lessons-types");
|
|
56
|
-
const LESSONS_DIR = '.vibe-check';
|
|
57
|
-
const LESSONS_FILE = 'lessons.json';
|
|
58
|
-
/**
|
|
59
|
-
* Get lessons database file path (global)
|
|
60
|
-
*/
|
|
61
|
-
function getLessonsPath() {
|
|
62
|
-
return path.join(os.homedir(), LESSONS_DIR, LESSONS_FILE);
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Create initial empty lessons database
|
|
66
|
-
*/
|
|
67
|
-
function createInitialLessonsDatabase() {
|
|
68
|
-
const now = new Date().toISOString();
|
|
69
|
-
return {
|
|
70
|
-
version: lessons_types_1.LESSONS_DB_VERSION,
|
|
71
|
-
lastUpdated: now,
|
|
72
|
-
lastSynthesis: '',
|
|
73
|
-
lessons: [],
|
|
74
|
-
lessonsByPattern: {},
|
|
75
|
-
stats: {
|
|
76
|
-
totalLessons: 0,
|
|
77
|
-
activeLessons: 0,
|
|
78
|
-
patternsWithLessons: 0,
|
|
79
|
-
averageConfidence: 0,
|
|
80
|
-
totalTimeWastedMinutes: 0,
|
|
81
|
-
},
|
|
82
|
-
synthesisLog: [],
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* Load lessons database from disk
|
|
87
|
-
*/
|
|
88
|
-
function loadLessons() {
|
|
89
|
-
const filePath = getLessonsPath();
|
|
90
|
-
if (fs.existsSync(filePath)) {
|
|
91
|
-
try {
|
|
92
|
-
const data = fs.readFileSync(filePath, 'utf-8');
|
|
93
|
-
const db = JSON.parse(data);
|
|
94
|
-
return migrateLessonsDatabase(db);
|
|
95
|
-
}
|
|
96
|
-
catch {
|
|
97
|
-
return createInitialLessonsDatabase();
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
return createInitialLessonsDatabase();
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* Save lessons database to disk
|
|
104
|
-
*/
|
|
105
|
-
function saveLessons(db) {
|
|
106
|
-
const dirPath = path.join(os.homedir(), LESSONS_DIR);
|
|
107
|
-
const filePath = getLessonsPath();
|
|
108
|
-
if (!fs.existsSync(dirPath)) {
|
|
109
|
-
fs.mkdirSync(dirPath, { recursive: true });
|
|
110
|
-
}
|
|
111
|
-
// Update metadata
|
|
112
|
-
db.lastUpdated = new Date().toISOString();
|
|
113
|
-
db.stats = computeStats(db);
|
|
114
|
-
// Trim if too many lessons
|
|
115
|
-
if (db.lessons.length > lessons_types_1.MAX_LESSONS) {
|
|
116
|
-
db.lessons = trimLessons(db.lessons);
|
|
117
|
-
}
|
|
118
|
-
// Rebuild index
|
|
119
|
-
db.lessonsByPattern = buildPatternIndex(db.lessons);
|
|
120
|
-
fs.writeFileSync(filePath, JSON.stringify(db, null, 2));
|
|
121
|
-
}
|
|
122
|
-
/**
|
|
123
|
-
* Add or update a lesson in the database
|
|
124
|
-
*/
|
|
125
|
-
function upsertLesson(db, lesson) {
|
|
126
|
-
const existingIndex = db.lessons.findIndex(l => l.id === lesson.id);
|
|
127
|
-
if (existingIndex >= 0) {
|
|
128
|
-
// Update existing
|
|
129
|
-
db.lessons[existingIndex] = {
|
|
130
|
-
...lesson,
|
|
131
|
-
version: db.lessons[existingIndex].version + 1,
|
|
132
|
-
updatedAt: new Date().toISOString(),
|
|
133
|
-
};
|
|
134
|
-
}
|
|
135
|
-
else {
|
|
136
|
-
// Add new
|
|
137
|
-
db.lessons.push(lesson);
|
|
138
|
-
}
|
|
139
|
-
// Rebuild index
|
|
140
|
-
db.lessonsByPattern = buildPatternIndex(db.lessons);
|
|
141
|
-
return db;
|
|
142
|
-
}
|
|
143
|
-
/**
|
|
144
|
-
* Get lesson by ID
|
|
145
|
-
*/
|
|
146
|
-
function getLessonById(db, id) {
|
|
147
|
-
return db.lessons.find(l => l.id === id);
|
|
148
|
-
}
|
|
149
|
-
/**
|
|
150
|
-
* Get lessons for a pattern
|
|
151
|
-
*/
|
|
152
|
-
function getLessonsForPattern(db, pattern) {
|
|
153
|
-
const ids = db.lessonsByPattern[pattern] || [];
|
|
154
|
-
return ids
|
|
155
|
-
.map(id => db.lessons.find(l => l.id === id))
|
|
156
|
-
.filter((l) => l !== undefined && !l.dismissed);
|
|
157
|
-
}
|
|
158
|
-
/**
|
|
159
|
-
* Get all active (non-dismissed) lessons
|
|
160
|
-
*/
|
|
161
|
-
function getActiveLessons(db) {
|
|
162
|
-
return db.lessons.filter(l => !l.dismissed);
|
|
163
|
-
}
|
|
164
|
-
/**
|
|
165
|
-
* Dismiss a lesson
|
|
166
|
-
*/
|
|
167
|
-
function dismissLesson(db, lessonId) {
|
|
168
|
-
const lesson = db.lessons.find(l => l.id === lessonId);
|
|
169
|
-
if (lesson) {
|
|
170
|
-
lesson.dismissed = true;
|
|
171
|
-
lesson.updatedAt = new Date().toISOString();
|
|
172
|
-
}
|
|
173
|
-
return db;
|
|
174
|
-
}
|
|
175
|
-
/**
|
|
176
|
-
* Mark a lesson as applied with effectiveness score
|
|
177
|
-
*/
|
|
178
|
-
function applyLesson(db, lessonId, effectiveness) {
|
|
179
|
-
const lesson = db.lessons.find(l => l.id === lessonId);
|
|
180
|
-
if (lesson) {
|
|
181
|
-
lesson.applied = true;
|
|
182
|
-
lesson.appliedDate = new Date().toISOString();
|
|
183
|
-
lesson.userEffectiveness = effectiveness;
|
|
184
|
-
lesson.updatedAt = new Date().toISOString();
|
|
185
|
-
// Adjust confidence based on effectiveness
|
|
186
|
-
if (effectiveness >= 70) {
|
|
187
|
-
lesson.confidence = Math.min(100, lesson.confidence + 5);
|
|
188
|
-
}
|
|
189
|
-
else if (effectiveness < 40) {
|
|
190
|
-
lesson.confidence = Math.max(0, lesson.confidence - 10);
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
return db;
|
|
194
|
-
}
|
|
195
|
-
/**
|
|
196
|
-
* Build pattern → lesson IDs index
|
|
197
|
-
*/
|
|
198
|
-
function buildPatternIndex(lessons) {
|
|
199
|
-
const index = {};
|
|
200
|
-
for (const lesson of lessons) {
|
|
201
|
-
if (!index[lesson.pattern]) {
|
|
202
|
-
index[lesson.pattern] = [];
|
|
203
|
-
}
|
|
204
|
-
index[lesson.pattern].push(lesson.id);
|
|
205
|
-
}
|
|
206
|
-
return index;
|
|
207
|
-
}
|
|
208
|
-
/**
|
|
209
|
-
* Compute database statistics
|
|
210
|
-
*/
|
|
211
|
-
function computeStats(db) {
|
|
212
|
-
const activeLessons = db.lessons.filter(l => !l.dismissed);
|
|
213
|
-
const patterns = new Set(activeLessons.map(l => l.pattern));
|
|
214
|
-
const totalConfidence = activeLessons.reduce((sum, l) => sum + l.confidence, 0);
|
|
215
|
-
const totalTimeWasted = db.lessons.reduce((sum, l) => sum + l.totalTimeWasted, 0);
|
|
216
|
-
return {
|
|
217
|
-
totalLessons: db.lessons.length,
|
|
218
|
-
activeLessons: activeLessons.length,
|
|
219
|
-
patternsWithLessons: patterns.size,
|
|
220
|
-
averageConfidence: activeLessons.length > 0
|
|
221
|
-
? Math.round(totalConfidence / activeLessons.length)
|
|
222
|
-
: 0,
|
|
223
|
-
totalTimeWastedMinutes: totalTimeWasted,
|
|
224
|
-
};
|
|
225
|
-
}
|
|
226
|
-
/**
|
|
227
|
-
* Trim lessons to MAX_LESSONS, keeping most valuable
|
|
228
|
-
*/
|
|
229
|
-
function trimLessons(lessons) {
|
|
230
|
-
// Sort by: not dismissed, confidence, evidence count, recency
|
|
231
|
-
return lessons
|
|
232
|
-
.sort((a, b) => {
|
|
233
|
-
// Keep non-dismissed first
|
|
234
|
-
if (a.dismissed !== b.dismissed)
|
|
235
|
-
return a.dismissed ? 1 : -1;
|
|
236
|
-
// Higher confidence first
|
|
237
|
-
if (a.confidence !== b.confidence)
|
|
238
|
-
return b.confidence - a.confidence;
|
|
239
|
-
// More evidence first
|
|
240
|
-
if (a.evidenceCount !== b.evidenceCount)
|
|
241
|
-
return b.evidenceCount - a.evidenceCount;
|
|
242
|
-
// More recent first
|
|
243
|
-
return new Date(b.updatedAt).getTime() - new Date(a.updatedAt).getTime();
|
|
244
|
-
})
|
|
245
|
-
.slice(0, lessons_types_1.MAX_LESSONS);
|
|
246
|
-
}
|
|
247
|
-
/**
|
|
248
|
-
* Migrate old database versions
|
|
249
|
-
*/
|
|
250
|
-
function migrateLessonsDatabase(db) {
|
|
251
|
-
if (!db.version) {
|
|
252
|
-
db.version = lessons_types_1.LESSONS_DB_VERSION;
|
|
253
|
-
}
|
|
254
|
-
// Ensure all fields exist
|
|
255
|
-
if (!db.synthesisLog) {
|
|
256
|
-
db.synthesisLog = [];
|
|
257
|
-
}
|
|
258
|
-
if (!db.lessonsByPattern) {
|
|
259
|
-
db.lessonsByPattern = buildPatternIndex(db.lessons || []);
|
|
260
|
-
}
|
|
261
|
-
if (!db.stats) {
|
|
262
|
-
db.stats = computeStats(db);
|
|
263
|
-
}
|
|
264
|
-
return db;
|
|
265
|
-
}
|
|
266
|
-
//# sourceMappingURL=lessons-storage.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"lessons-storage.js","sourceRoot":"","sources":["../../src/learning/lessons-storage.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBH,wCAEC;AAKD,oEAiBC;AAKD,kCAcC;AAKD,kCAqBC;AAKD,oCAmBC;AAKD,sCAEC;AAKD,oDAKC;AAKD,4CAEC;AAKD,sCAOC;AAKD,kCAoBC;AA1KD,uCAAyB;AACzB,2CAA6B;AAC7B,uCAAyB;AACzB,mDAKyB;AAEzB,MAAM,WAAW,GAAG,aAAa,CAAC;AAClC,M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1
|
-
/**
|
|
2
|
-
* Lessons Database Types
|
|
3
|
-
*
|
|
4
|
-
* A lesson is a persistent learning extracted from pattern + intervention data.
|
|
5
|
-
* Unlike nudges (ephemeral), lessons accumulate and get smarter over time.
|
|
6
|
-
*/
|
|
7
|
-
import { InterventionType } from '../gamification/types';
|
|
8
|
-
/**
|
|
9
|
-
* A single lesson learned from recurring patterns
|
|
10
|
-
*/
|
|
11
|
-
export interface Lesson {
|
|
12
|
-
id: string;
|
|
13
|
-
version: number;
|
|
14
|
-
createdAt: string;
|
|
15
|
-
updatedAt: string;
|
|
16
|
-
pattern: string;
|
|
17
|
-
components: string[];
|
|
18
|
-
title: string;
|
|
19
|
-
description: string;
|
|
20
|
-
rootCause?: string;
|
|
21
|
-
prevention: string[];
|
|
22
|
-
interventions: LessonIntervention[];
|
|
23
|
-
confidence: number;
|
|
24
|
-
evidenceCount: number;
|
|
25
|
-
totalTimeWasted: number;
|
|
26
|
-
dismissed: boolean;
|
|
27
|
-
applied: boolean;
|
|
28
|
-
appliedDate?: string;
|
|
29
|
-
userEffectiveness?: number;
|
|
30
|
-
severity: 'critical' | 'high' | 'medium' | 'low';
|
|
31
|
-
tags: string[];
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* An intervention associated with a lesson
|
|
35
|
-
*/
|
|
36
|
-
export interface LessonIntervention {
|
|
37
|
-
type: InterventionType;
|
|
38
|
-
successCount: number;
|
|
39
|
-
totalCount: number;
|
|
40
|
-
effectiveness: number;
|
|
41
|
-
notes?: string;
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* The lessons database
|
|
45
|
-
*/
|
|
46
|
-
export interface LessonsDatabase {
|
|
47
|
-
version: string;
|
|
48
|
-
lastUpdated: string;
|
|
49
|
-
lastSynthesis: string;
|
|
50
|
-
lessons: Lesson[];
|
|
51
|
-
lessonsByPattern: Record<string, string[]>;
|
|
52
|
-
stats: {
|
|
53
|
-
totalLessons: number;
|
|
54
|
-
activeLessons: number;
|
|
55
|
-
patternsWithLessons: number;
|
|
56
|
-
averageConfidence: number;
|
|
57
|
-
totalTimeWastedMinutes: number;
|
|
58
|
-
};
|
|
59
|
-
synthesisLog: SynthesisLogEntry[];
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Log entry for synthesis runs
|
|
63
|
-
*/
|
|
64
|
-
export interface SynthesisLogEntry {
|
|
65
|
-
timestamp: string;
|
|
66
|
-
lessonsCreated: number;
|
|
67
|
-
lessonsUpdated: number;
|
|
68
|
-
patternsProcessed: number;
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Result of surfacing lessons for a context
|
|
72
|
-
*/
|
|
73
|
-
export interface SurfacedLesson {
|
|
74
|
-
lesson: Lesson;
|
|
75
|
-
relevanceScore: number;
|
|
76
|
-
reason: string;
|
|
77
|
-
suggestedIntervention?: InterventionType;
|
|
78
|
-
}
|
|
79
|
-
export declare const LESSONS_DB_VERSION = "1.0.0";
|
|
80
|
-
export declare const SYNTHESIS_THRESHOLD = 2;
|
|
81
|
-
export declare const MAX_LESSONS = 100;
|
|
82
|
-
export declare const CONFIDENCE_BASE = 50;
|
|
83
|
-
//# sourceMappingURL=lessons-types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"lessons-types.d.ts","sourceRoot":"","sources":["../../src/learning/lessons-types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD;;GAEG;AACH,MAAM,WAAW,MAAM;IAErB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAGlB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,EAAE,CAAC;IAGrB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,E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vB,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,qBAAqB,CAAC,EAAE,gBAAgB,CAAC;CAC1C;AAGD,eAAO,MAAM,kBAAkB,UAAU,CAAC;AAC1C,eAAO,MAAM,mBAAmB,IAAI,CAAC;AACrC,eAAO,MAAM,WAAW,MAAM,CAAC;AAC/B,eAAO,MAAM,eAAe,KAAK,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Lessons Database Types
|
|
4
|
-
*
|
|
5
|
-
* A lesson is a persistent learning extracted from pattern + intervention data.
|
|
6
|
-
* Unlike nudges (ephemeral), lessons accumulate and get smarter over time.
|
|
7
|
-
*/
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.CONFIDENCE_BASE = exports.MAX_LESSONS = exports.SYNTHESIS_THRESHOLD = exports.LESSONS_DB_VERSION = void 0;
|
|
10
|
-
// Constants
|
|
11
|
-
exports.LESSONS_DB_VERSION = '1.0.0';
|
|
12
|
-
exports.SYNTHESIS_THRESHOLD = 2; // Min occurrences to create lesson
|
|
13
|
-
exports.MAX_LESSONS = 100; // Cap lessons database
|
|
14
|
-
exports.CONFIDENCE_BASE = 50; // Starting confidence
|
|
15
|
-
//# sourceMappingURL=lessons-types.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"lessons-types.js","sourceRoot":"","sources":["../../src/learning/lessons-types.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAqGH,YAAY;AACC,QAAA,kBAAkB,GAAG,OAAO,CAAC;AAC7B,QAAA,mBAAmB,GAAG,CAAC,CAAC,CAAQ,mCAAmC;AACnE,QAAA,WAAW,GAAG,GAAG,CAAC,CAAc,uBAAuB;AACvD,QAAA,eAAe,GAAG,EAAE,CAAC,CAAW,sBAAsB"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Nudge Display System
|
|
3
|
-
*
|
|
4
|
-
* Formats and displays nudges in CLI output.
|
|
5
|
-
*/
|
|
6
|
-
import { Nudge } from './types';
|
|
7
|
-
/**
|
|
8
|
-
* Format nudges for CLI display (after gamification section)
|
|
9
|
-
*/
|
|
10
|
-
export declare function formatNudgesForCli(maxDisplay?: number): string[];
|
|
11
|
-
/**
|
|
12
|
-
* Get nudge summary for profile command
|
|
13
|
-
*/
|
|
14
|
-
export declare function getNudgeSummary(): {
|
|
15
|
-
pending: number;
|
|
16
|
-
displayed: number;
|
|
17
|
-
dismissed: number;
|
|
18
|
-
nudges: Nudge[];
|
|
19
|
-
};
|
|
20
|
-
//# sourceMappingURL=nudges.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"nudges.d.ts","sourceRoot":"","sources":["../../src/learning/nudges.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAGhC;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,GAAE,MAAU,GAAG,MAAM,EAAE,CA0BnE;AAwBD;;GAEG;AACH,wBAAgB,eAAe,IAAI;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,KAAK,EAAE,CAAC;CACjB,CAUA"}
|