fivocell 5.0.0 → 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/__tests__/code-health.test.d.ts +2 -0
- package/dist/__tests__/code-health.test.d.ts.map +1 -0
- package/dist/__tests__/code-health.test.js +90 -0
- package/dist/__tests__/code-health.test.js.map +1 -0
- package/dist/__tests__/developer-velocity.test.d.ts +2 -0
- package/dist/__tests__/developer-velocity.test.d.ts.map +1 -0
- package/dist/__tests__/developer-velocity.test.js +66 -0
- package/dist/__tests__/developer-velocity.test.js.map +1 -0
- package/dist/__tests__/error-trends.test.d.ts +2 -0
- package/dist/__tests__/error-trends.test.d.ts.map +1 -0
- package/dist/__tests__/error-trends.test.js +61 -0
- package/dist/__tests__/error-trends.test.js.map +1 -0
- package/dist/__tests__/memory-growth.test.d.ts +2 -0
- package/dist/__tests__/memory-growth.test.d.ts.map +1 -0
- package/dist/__tests__/memory-growth.test.js +61 -0
- package/dist/__tests__/memory-growth.test.js.map +1 -0
- package/dist/walls/06-memory/stores/code-health.d.ts +40 -0
- package/dist/walls/06-memory/stores/code-health.d.ts.map +1 -0
- package/dist/walls/06-memory/stores/code-health.js +344 -0
- package/dist/walls/06-memory/stores/code-health.js.map +1 -0
- package/dist/walls/06-memory/stores/developer-velocity.d.ts +53 -0
- package/dist/walls/06-memory/stores/developer-velocity.d.ts.map +1 -0
- package/dist/walls/06-memory/stores/developer-velocity.js +225 -0
- package/dist/walls/06-memory/stores/developer-velocity.js.map +1 -0
- package/dist/walls/06-memory/stores/error-trends.d.ts +53 -0
- package/dist/walls/06-memory/stores/error-trends.d.ts.map +1 -0
- package/dist/walls/06-memory/stores/error-trends.js +232 -0
- package/dist/walls/06-memory/stores/error-trends.js.map +1 -0
- package/dist/walls/06-memory/stores/memory-growth.d.ts +34 -0
- package/dist/walls/06-memory/stores/memory-growth.d.ts.map +1 -0
- package/dist/walls/06-memory/stores/memory-growth.js +150 -0
- package/dist/walls/06-memory/stores/memory-growth.js.map +1 -0
- package/dist/walls/07-runtime/cli/cli.js +67 -0
- package/dist/walls/07-runtime/cli/cli.js.map +1 -1
- package/dist/walls/07-runtime/daemon/server.d.ts.map +1 -1
- package/dist/walls/07-runtime/daemon/server.js +29 -0
- package/dist/walls/07-runtime/daemon/server.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export interface ErrorTrend {
|
|
2
|
+
project: string;
|
|
3
|
+
period: string;
|
|
4
|
+
summary: ErrorSummary;
|
|
5
|
+
dailyTrend: ErrorDailyTrend[];
|
|
6
|
+
regressions: ErrorRegression[];
|
|
7
|
+
topErrors: TopError[];
|
|
8
|
+
fixRate: FixRate;
|
|
9
|
+
chart: string;
|
|
10
|
+
}
|
|
11
|
+
export interface ErrorSummary {
|
|
12
|
+
totalErrors: number;
|
|
13
|
+
totalFixes: number;
|
|
14
|
+
unfixedErrors: number;
|
|
15
|
+
errorRate: number;
|
|
16
|
+
avgErrorsPerDay: number;
|
|
17
|
+
peakErrorDay: string;
|
|
18
|
+
peakErrorCount: number;
|
|
19
|
+
trend: 'improving' | 'stable' | 'worsening';
|
|
20
|
+
}
|
|
21
|
+
export interface ErrorDailyTrend {
|
|
22
|
+
date: string;
|
|
23
|
+
errors: number;
|
|
24
|
+
fixes: number;
|
|
25
|
+
errorRate: number;
|
|
26
|
+
}
|
|
27
|
+
export interface ErrorRegression {
|
|
28
|
+
pattern: string;
|
|
29
|
+
count: number;
|
|
30
|
+
firstSeen: string;
|
|
31
|
+
lastSeen: string;
|
|
32
|
+
severity: 'high' | 'medium' | 'low';
|
|
33
|
+
suggestion: string;
|
|
34
|
+
}
|
|
35
|
+
export interface TopError {
|
|
36
|
+
summary: string;
|
|
37
|
+
count: number;
|
|
38
|
+
topic: string | null;
|
|
39
|
+
importance: number;
|
|
40
|
+
lastSeen: string;
|
|
41
|
+
fixed: boolean;
|
|
42
|
+
}
|
|
43
|
+
export interface FixRate {
|
|
44
|
+
total: number;
|
|
45
|
+
fixed: number;
|
|
46
|
+
rate: number;
|
|
47
|
+
avgTimeToFix: string;
|
|
48
|
+
fastestFix: string;
|
|
49
|
+
slowestFix: string;
|
|
50
|
+
}
|
|
51
|
+
export declare function computeErrorTrends(project: string, days?: number): ErrorTrend;
|
|
52
|
+
export declare function formatErrorTrend(trend: ErrorTrend): string;
|
|
53
|
+
//# sourceMappingURL=error-trends.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-trends.d.ts","sourceRoot":"","sources":["../../../../src/walls/06-memory/stores/error-trends.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,YAAY,CAAC;IACtB,UAAU,EAAE,eAAe,EAAE,CAAC;IAC9B,WAAW,EAAE,eAAe,EAAE,CAAC;IAC/B,SAAS,EAAE,QAAQ,EAAE,CAAC;IACtB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,YAAY;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,WAAW,GAAG,QAAQ,GAAG,WAAW,CAAC;CAC7C;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAC;IACpC,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,QAAQ;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,WAAW,OAAO;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,GAAE,MAAW,GAAG,UAAU,CAkLjF;AAmDD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAsC1D"}
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.computeErrorTrends = computeErrorTrends;
|
|
4
|
+
exports.formatErrorTrend = formatErrorTrend;
|
|
5
|
+
const database_1 = require("../database/database");
|
|
6
|
+
function computeErrorTrends(project, days = 30) {
|
|
7
|
+
const db = (0, database_1.getDb)();
|
|
8
|
+
const since = new Date(Date.now() - days * 86400000).toISOString();
|
|
9
|
+
// Total errors and fixes
|
|
10
|
+
const errorCount = db.prepare("SELECT COUNT(*) as c FROM memory_events WHERE project = ? AND type = 'error' AND created_at >= ?").get(project, since);
|
|
11
|
+
const fixCount = db.prepare("SELECT COUNT(*) as c FROM memory_events WHERE project = ? AND type = 'fix' AND created_at >= ?").get(project, since);
|
|
12
|
+
// Daily trend
|
|
13
|
+
const dailyErrors = db.prepare(`
|
|
14
|
+
SELECT date(created_at) as date, COUNT(*) as count FROM memory_events
|
|
15
|
+
WHERE project = ? AND type = 'error' AND created_at >= ?
|
|
16
|
+
GROUP BY date(created_at) ORDER BY date
|
|
17
|
+
`).all(project, since);
|
|
18
|
+
const dailyFixes = db.prepare(`
|
|
19
|
+
SELECT date(created_at) as date, COUNT(*) as count FROM memory_events
|
|
20
|
+
WHERE project = ? AND type = 'fix' AND created_at >= ?
|
|
21
|
+
GROUP BY date(created_at) ORDER BY date
|
|
22
|
+
`).all(project, since);
|
|
23
|
+
const dailyTotal = db.prepare(`
|
|
24
|
+
SELECT date(created_at) as date, COUNT(*) as count FROM memory_events
|
|
25
|
+
WHERE project = ? AND created_at >= ?
|
|
26
|
+
GROUP BY date(created_at) ORDER BY date
|
|
27
|
+
`).all(project, since);
|
|
28
|
+
const errorMap = new Map(dailyErrors.map(r => [r.date, r.count]));
|
|
29
|
+
const fixMap = new Map(dailyFixes.map(r => [r.date, r.count]));
|
|
30
|
+
const totalMap = new Map(dailyTotal.map(r => [r.date, r.count]));
|
|
31
|
+
const allDates = [...new Set([...errorMap.keys(), ...fixMap.keys(), ...totalMap.keys()])].sort();
|
|
32
|
+
const dailyTrend = allDates.map(date => {
|
|
33
|
+
const errors = errorMap.get(date) || 0;
|
|
34
|
+
const fixes = fixMap.get(date) || 0;
|
|
35
|
+
const total = totalMap.get(date) || 1;
|
|
36
|
+
return { date, errors, fixes, errorRate: Math.round(errors / total * 100) };
|
|
37
|
+
});
|
|
38
|
+
// Peak error day
|
|
39
|
+
const peakDay = dailyErrors.reduce((max, r) => r.count > max.count ? r : max, { date: 'none', count: 0 });
|
|
40
|
+
// Trend detection (compare first half vs second half)
|
|
41
|
+
const half = Math.floor(dailyTrend.length / 2);
|
|
42
|
+
const firstHalfRate = dailyTrend.slice(0, half);
|
|
43
|
+
const secondHalfRate = dailyTrend.slice(half);
|
|
44
|
+
const firstAvg = firstHalfRate.length > 0 ? firstHalfRate.reduce((s, d) => s + d.errorRate, 0) / firstHalfRate.length : 0;
|
|
45
|
+
const secondAvg = secondHalfRate.length > 0 ? secondHalfRate.reduce((s, d) => s + d.errorRate, 0) / secondHalfRate.length : 0;
|
|
46
|
+
let trend = 'stable';
|
|
47
|
+
if (secondAvg < firstAvg * 0.8)
|
|
48
|
+
trend = 'improving';
|
|
49
|
+
else if (secondAvg > firstAvg * 1.2)
|
|
50
|
+
trend = 'worsening';
|
|
51
|
+
const avgErrorsPerDay = dailyTrend.length > 0
|
|
52
|
+
? Math.round(dailyTrend.reduce((s, d) => s + d.errors, 0) / dailyTrend.length * 10) / 10
|
|
53
|
+
: 0;
|
|
54
|
+
const totalEvents = db.prepare('SELECT COUNT(*) as c FROM memory_events WHERE project = ? AND created_at >= ?').get(project, since);
|
|
55
|
+
const summary = {
|
|
56
|
+
totalErrors: errorCount.c,
|
|
57
|
+
totalFixes: fixCount.c,
|
|
58
|
+
unfixedErrors: errorCount.c - fixCount.c,
|
|
59
|
+
errorRate: totalEvents.c > 0 ? Math.round(errorCount.c / totalEvents.c * 100) : 0,
|
|
60
|
+
avgErrorsPerDay,
|
|
61
|
+
peakErrorDay: peakDay.date,
|
|
62
|
+
peakErrorCount: peakDay.count,
|
|
63
|
+
trend,
|
|
64
|
+
};
|
|
65
|
+
// Regressions: errors that appear in second half but not first
|
|
66
|
+
const firstHalfErrors = new Set(db.prepare(`
|
|
67
|
+
SELECT DISTINCT summary FROM memory_events
|
|
68
|
+
WHERE project = ? AND type = 'error' AND created_at >= ? AND created_at < ?
|
|
69
|
+
`).all(project, since, new Date(Date.now() - days / 2 * 86400000).toISOString()).map((r) => r.summary));
|
|
70
|
+
const secondHalfErrors = db.prepare(`
|
|
71
|
+
SELECT summary, COUNT(*) as c FROM memory_events
|
|
72
|
+
WHERE project = ? AND type = 'error' AND created_at >= ?
|
|
73
|
+
GROUP BY summary HAVING c >= 2
|
|
74
|
+
`).all(project, new Date(Date.now() - days / 2 * 86400000).toISOString());
|
|
75
|
+
const regressions = secondHalfErrors
|
|
76
|
+
.filter(e => !firstHalfErrors.has(e.summary))
|
|
77
|
+
.map(e => ({
|
|
78
|
+
pattern: e.summary.slice(0, 100),
|
|
79
|
+
count: e.c,
|
|
80
|
+
firstSeen: since,
|
|
81
|
+
lastSeen: new Date().toISOString(),
|
|
82
|
+
severity: e.c > 5 ? 'high' : e.c > 2 ? 'medium' : 'low',
|
|
83
|
+
suggestion: e.c > 3 ? 'Systematic fix needed' : 'Monitor for recurrence',
|
|
84
|
+
}));
|
|
85
|
+
// Top errors
|
|
86
|
+
const topErrorRows = db.prepare(`
|
|
87
|
+
SELECT summary, COUNT(*) as c, topic, importance, MAX(created_at) as lastSeen
|
|
88
|
+
FROM memory_events WHERE project = ? AND type = 'error' AND created_at >= ?
|
|
89
|
+
GROUP BY summary ORDER BY c DESC LIMIT 10
|
|
90
|
+
`).all(project, since);
|
|
91
|
+
const fixedSummaries = new Set(db.prepare(`
|
|
92
|
+
SELECT DISTINCT summary FROM memory_events WHERE project = ? AND type = 'fix' AND created_at >= ?
|
|
93
|
+
`).all(project, since).map((r) => r.summary));
|
|
94
|
+
const topErrors = topErrorRows.map(r => ({
|
|
95
|
+
summary: r.summary.slice(0, 120),
|
|
96
|
+
count: r.c,
|
|
97
|
+
topic: r.topic,
|
|
98
|
+
importance: r.importance,
|
|
99
|
+
lastSeen: r.lastSeen,
|
|
100
|
+
fixed: fixedSummaries.has(r.summary),
|
|
101
|
+
}));
|
|
102
|
+
// Fix rate
|
|
103
|
+
const fixRateRows = db.prepare(`
|
|
104
|
+
SELECT e.summary as errorSummary, e.created_at as errorTime, f.created_at as fixTime
|
|
105
|
+
FROM memory_events e
|
|
106
|
+
JOIN memory_events f ON f.project = e.project AND f.type = 'fix'
|
|
107
|
+
WHERE e.project = ? AND e.type = 'error' AND e.created_at >= ?
|
|
108
|
+
AND f.created_at > e.created_at
|
|
109
|
+
ORDER BY e.created_at, f.created_at
|
|
110
|
+
`).all(project, since);
|
|
111
|
+
// Deduplicate: pair each error with its closest fix
|
|
112
|
+
const fixTimes = [];
|
|
113
|
+
const errorTimes = db.prepare(`
|
|
114
|
+
SELECT created_at FROM memory_events WHERE project = ? AND type = 'error' AND created_at >= ? ORDER BY created_at
|
|
115
|
+
`).all(project, since);
|
|
116
|
+
const fixTimesAll = db.prepare(`
|
|
117
|
+
SELECT created_at FROM memory_events WHERE project = ? AND type = 'fix' AND created_at >= ? ORDER BY created_at
|
|
118
|
+
`).all(project, since);
|
|
119
|
+
for (const err of errorTimes) {
|
|
120
|
+
const closestFix = fixTimesAll.find(f => new Date(f.created_at) > new Date(err.created_at));
|
|
121
|
+
if (closestFix) {
|
|
122
|
+
fixTimes.push(new Date(closestFix.created_at).getTime() - new Date(err.created_at).getTime());
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
const avgFixMs = fixTimes.length > 0 ? fixTimes.reduce((s, t) => s + t, 0) / fixTimes.length : 0;
|
|
126
|
+
const minFix = fixTimes.length > 0 ? Math.min(...fixTimes) : 0;
|
|
127
|
+
const maxFix = fixTimes.length > 0 ? Math.max(...fixTimes) : 0;
|
|
128
|
+
const fixRate = {
|
|
129
|
+
total: errorCount.c,
|
|
130
|
+
fixed: fixCount.c,
|
|
131
|
+
rate: errorCount.c > 0 ? Math.round(fixCount.c / errorCount.c * 100) : 0,
|
|
132
|
+
avgTimeToFix: formatDuration(avgFixMs),
|
|
133
|
+
fastestFix: formatDuration(minFix),
|
|
134
|
+
slowestFix: formatDuration(maxFix),
|
|
135
|
+
};
|
|
136
|
+
// Chart
|
|
137
|
+
const chart = renderErrorChart(dailyTrend, summary);
|
|
138
|
+
return {
|
|
139
|
+
project,
|
|
140
|
+
period: `${days}d`,
|
|
141
|
+
summary,
|
|
142
|
+
dailyTrend,
|
|
143
|
+
regressions,
|
|
144
|
+
topErrors,
|
|
145
|
+
fixRate,
|
|
146
|
+
chart,
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
function renderErrorChart(trend, summary) {
|
|
150
|
+
if (trend.length === 0)
|
|
151
|
+
return ' No error data.';
|
|
152
|
+
const maxErrors = Math.max(...trend.map(t => t.errors), 1);
|
|
153
|
+
const chartHeight = 8;
|
|
154
|
+
const lines = [];
|
|
155
|
+
lines.push(` Error Trend — ${summary.trend.toUpperCase()} (rate: ${summary.errorRate}%)`);
|
|
156
|
+
lines.push('');
|
|
157
|
+
for (let row = chartHeight; row >= 1; row--) {
|
|
158
|
+
const threshold = (row / chartHeight) * maxErrors;
|
|
159
|
+
const label = row === chartHeight ? String(maxErrors).padStart(4) : row === 1 ? ' 1' : ' ';
|
|
160
|
+
let line = ` ${label} │`;
|
|
161
|
+
for (const t of trend) {
|
|
162
|
+
if (t.errors >= threshold) {
|
|
163
|
+
line += ' ▓';
|
|
164
|
+
}
|
|
165
|
+
else if (t.fixes >= threshold) {
|
|
166
|
+
line += ' ░';
|
|
167
|
+
}
|
|
168
|
+
else {
|
|
169
|
+
line += ' ';
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
lines.push(line);
|
|
173
|
+
}
|
|
174
|
+
lines.push(` └${'─'.repeat(trend.length * 2)}`);
|
|
175
|
+
if (trend.length > 0) {
|
|
176
|
+
const first = trend[0].date.slice(5);
|
|
177
|
+
const last = trend[trend.length - 1].date.slice(5);
|
|
178
|
+
lines.push(` ${first}${' '.repeat(Math.max(0, trend.length * 2 - first.length - last.length))}${last}`);
|
|
179
|
+
}
|
|
180
|
+
lines.push('');
|
|
181
|
+
lines.push(` ▓ errors ░ fixes`);
|
|
182
|
+
lines.push(` Errors: ${summary.totalErrors} | Fixes: ${summary.totalFixes} | Unfixed: ${summary.unfixedErrors}`);
|
|
183
|
+
return lines.join('\n');
|
|
184
|
+
}
|
|
185
|
+
function formatDuration(ms) {
|
|
186
|
+
if (ms === 0)
|
|
187
|
+
return 'N/A';
|
|
188
|
+
if (ms < 60000)
|
|
189
|
+
return `${Math.round(ms / 1000)}s`;
|
|
190
|
+
if (ms < 3600000)
|
|
191
|
+
return `${Math.round(ms / 60000)}min`;
|
|
192
|
+
if (ms < 86400000)
|
|
193
|
+
return `${Math.round(ms / 3600000)}h`;
|
|
194
|
+
return `${Math.round(ms / 86400000)}d`;
|
|
195
|
+
}
|
|
196
|
+
function formatErrorTrend(trend) {
|
|
197
|
+
const lines = [];
|
|
198
|
+
lines.push(`## Error Trend — ${trend.project} (${trend.period})\n`);
|
|
199
|
+
lines.push(trend.chart);
|
|
200
|
+
lines.push('');
|
|
201
|
+
lines.push(`### Summary`);
|
|
202
|
+
lines.push(`| Metric | Value |`);
|
|
203
|
+
lines.push(`|--------|-------|`);
|
|
204
|
+
lines.push(`| Total errors | ${trend.summary.totalErrors} |`);
|
|
205
|
+
lines.push(`| Total fixes | ${trend.summary.totalFixes} |`);
|
|
206
|
+
lines.push(`| Unfixed | ${trend.summary.unfixedErrors} |`);
|
|
207
|
+
lines.push(`| Error rate | ${trend.summary.errorRate}% |`);
|
|
208
|
+
lines.push(`| Avg/day | ${trend.summary.avgErrorsPerDay} |`);
|
|
209
|
+
lines.push(`| Peak day | ${trend.summary.peakErrorDay} (${trend.summary.peakErrorCount}) |`);
|
|
210
|
+
lines.push(`| Trend | ${trend.summary.trend} |`);
|
|
211
|
+
lines.push('');
|
|
212
|
+
lines.push(`### Fix Rate`);
|
|
213
|
+
lines.push(`- Fixed: ${trend.fixRate.rate}%`);
|
|
214
|
+
lines.push(`- Avg time to fix: ${trend.fixRate.avgTimeToFix}`);
|
|
215
|
+
lines.push(`- Fastest: ${trend.fixRate.fastestFix} | Slowest: ${trend.fixRate.slowestFix}`);
|
|
216
|
+
if (trend.regressions.length > 0) {
|
|
217
|
+
lines.push('');
|
|
218
|
+
lines.push(`### Regressions`);
|
|
219
|
+
for (const r of trend.regressions) {
|
|
220
|
+
lines.push(`- [${r.severity}] ${r.pattern} (×${r.count}) — ${r.suggestion}`);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
if (trend.topErrors.length > 0) {
|
|
224
|
+
lines.push('');
|
|
225
|
+
lines.push(`### Top Errors`);
|
|
226
|
+
for (const e of trend.topErrors.slice(0, 5)) {
|
|
227
|
+
lines.push(`- ${e.fixed ? '✓' : '✗'} [×${e.count}] ${e.summary}`);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
return lines.join('\n');
|
|
231
|
+
}
|
|
232
|
+
//# sourceMappingURL=error-trends.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-trends.js","sourceRoot":"","sources":["../../../../src/walls/06-memory/stores/error-trends.ts"],"names":[],"mappings":";;AA0DA,gDAkLC;AAmDD,4CAsCC;AArUD,mDAA6C;AA0D7C,SAAgB,kBAAkB,CAAC,OAAe,EAAE,OAAe,EAAE;IACnE,MAAM,EAAE,GAAG,IAAA,gBAAK,GAAE,CAAC;IACnB,MAAM,KAAK,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,GAAG,QAAQ,CAAC,CAAC,WAAW,EAAE,CAAC;IAEnE,yBAAyB;IACzB,MAAM,UAAU,GAAG,EAAE,CAAC,OAAO,CAC3B,kGAAkG,CACnG,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAkB,CAAC;IACvC,MAAM,QAAQ,GAAG,EAAE,CAAC,OAAO,CACzB,gGAAgG,CACjG,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAkB,CAAC;IAEvC,cAAc;IACd,MAAM,WAAW,GAAG,EAAE,CAAC,OAAO,CAAC;;;;GAI9B,CAAC,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAA2C,CAAC;IAEjE,MAAM,UAAU,GAAG,EAAE,CAAC,OAAO,CAAC;;;;GAI7B,CAAC,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAA2C,CAAC;IAEjE,MAAM,UAAU,GAAG,EAAE,CAAC,OAAO,CAAC;;;;GAI7B,CAAC,CAAC,GAAG,CAAC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1,34 @@
|
|
|
1
|
+
export interface GrowthTrend {
|
|
2
|
+
project: string;
|
|
3
|
+
period: string;
|
|
4
|
+
dataPoints: GrowthDataPoint[];
|
|
5
|
+
summary: GrowthSummary;
|
|
6
|
+
prediction: GrowthPrediction;
|
|
7
|
+
chart: string;
|
|
8
|
+
}
|
|
9
|
+
export interface GrowthDataPoint {
|
|
10
|
+
date: string;
|
|
11
|
+
totalEvents: number;
|
|
12
|
+
newEvents: number;
|
|
13
|
+
avgImportance: number;
|
|
14
|
+
types: Record<string, number>;
|
|
15
|
+
}
|
|
16
|
+
export interface GrowthSummary {
|
|
17
|
+
totalEvents: number;
|
|
18
|
+
eventsLast7d: number;
|
|
19
|
+
eventsLast30d: number;
|
|
20
|
+
avgDailyGrowth: number;
|
|
21
|
+
peakDay: string;
|
|
22
|
+
peakDayCount: number;
|
|
23
|
+
growthRate: number;
|
|
24
|
+
trend: 'accelerating' | 'steady' | 'decelerating' | 'declining';
|
|
25
|
+
}
|
|
26
|
+
export interface GrowthPrediction {
|
|
27
|
+
next7dEstimate: number;
|
|
28
|
+
next30dEstimate: number;
|
|
29
|
+
confidence: number;
|
|
30
|
+
basedOnDays: number;
|
|
31
|
+
}
|
|
32
|
+
export declare function computeGrowthTrends(project: string, days?: number): GrowthTrend;
|
|
33
|
+
export declare function formatGrowthTrend(trend: GrowthTrend): string;
|
|
34
|
+
//# sourceMappingURL=memory-growth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"memory-growth.d.ts","sourceRoot":"","sources":["../../../../src/walls/06-memory/stores/memory-growth.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,eAAe,EAAE,CAAC;IAC9B,OAAO,EAAE,aAAa,CAAC;IACvB,UAAU,EAAE,gBAAgB,CAAC;IAC7B,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC/B;AAED,MAAM,WAAW,aAAa;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,cAAc,GAAG,QAAQ,GAAG,cAAc,GAAG,WAAW,CAAC;CACjE;AAED,MAAM,WAAW,gBAAgB;IAC/B,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,GAAE,MAAW,GAAG,WAAW,CAsGnF;AA2CD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,CAqB5D"}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.computeGrowthTrends = computeGrowthTrends;
|
|
4
|
+
exports.formatGrowthTrend = formatGrowthTrend;
|
|
5
|
+
const database_1 = require("../database/database");
|
|
6
|
+
function computeGrowthTrends(project, days = 30) {
|
|
7
|
+
const db = (0, database_1.getDb)();
|
|
8
|
+
const since = new Date(Date.now() - days * 86400000).toISOString();
|
|
9
|
+
// Daily event counts
|
|
10
|
+
const dailyRows = db.prepare(`
|
|
11
|
+
SELECT date(created_at) as date, COUNT(*) as count, AVG(importance) as avgImp
|
|
12
|
+
FROM memory_events WHERE project = ? AND created_at >= ?
|
|
13
|
+
GROUP BY date(created_at) ORDER BY date
|
|
14
|
+
`).all(project, since);
|
|
15
|
+
// Type breakdown per day
|
|
16
|
+
const typeRows = db.prepare(`
|
|
17
|
+
SELECT date(created_at) as date, type, COUNT(*) as count
|
|
18
|
+
FROM memory_events WHERE project = ? AND created_at >= ?
|
|
19
|
+
GROUP BY date(created_at), type ORDER BY date
|
|
20
|
+
`).all(project, since);
|
|
21
|
+
const typeByDay = {};
|
|
22
|
+
for (const r of typeRows) {
|
|
23
|
+
if (!typeByDay[r.date])
|
|
24
|
+
typeByDay[r.date] = {};
|
|
25
|
+
typeByDay[r.date][r.type] = r.count;
|
|
26
|
+
}
|
|
27
|
+
// Build data points
|
|
28
|
+
const dataPoints = dailyRows.map((r, i) => ({
|
|
29
|
+
date: r.date,
|
|
30
|
+
totalEvents: dailyRows.slice(0, i + 1).reduce((s, d) => s + d.count, 0),
|
|
31
|
+
newEvents: r.count,
|
|
32
|
+
avgImportance: Math.round(r.avgImp * 10) / 10,
|
|
33
|
+
types: typeByDay[r.date] || {},
|
|
34
|
+
}));
|
|
35
|
+
// Summary
|
|
36
|
+
const totalRow = db.prepare('SELECT COUNT(*) as c FROM memory_events WHERE project = ?').get(project);
|
|
37
|
+
const since7d = new Date(Date.now() - 7 * 86400000).toISOString();
|
|
38
|
+
const since30d = new Date(Date.now() - 30 * 86400000).toISOString();
|
|
39
|
+
const last7d = db.prepare('SELECT COUNT(*) as c FROM memory_events WHERE project = ? AND created_at >= ?').get(project, since7d);
|
|
40
|
+
const last30d = db.prepare('SELECT COUNT(*) as c FROM memory_events WHERE project = ? AND created_at >= ?').get(project, since30d);
|
|
41
|
+
const avgDaily = dataPoints.length > 0
|
|
42
|
+
? Math.round(dataPoints.reduce((s, d) => s + d.newEvents, 0) / dataPoints.length * 10) / 10
|
|
43
|
+
: 0;
|
|
44
|
+
const peak = dataPoints.reduce((max, d) => d.newEvents > max.newEvents ? d : max, { date: 'none', newEvents: 0 });
|
|
45
|
+
// Growth rate: compare last half vs first half
|
|
46
|
+
const half = Math.floor(dataPoints.length / 2);
|
|
47
|
+
const firstHalf = dataPoints.slice(0, half);
|
|
48
|
+
const secondHalf = dataPoints.slice(half);
|
|
49
|
+
const firstAvg = firstHalf.length > 0 ? firstHalf.reduce((s, d) => s + d.newEvents, 0) / firstHalf.length : 0;
|
|
50
|
+
const secondAvg = secondHalf.length > 0 ? secondHalf.reduce((s, d) => s + d.newEvents, 0) / secondHalf.length : 0;
|
|
51
|
+
const growthRate = firstAvg > 0 ? Math.round((secondAvg - firstAvg) / firstAvg * 100) : 0;
|
|
52
|
+
let trend = 'steady';
|
|
53
|
+
if (growthRate > 20)
|
|
54
|
+
trend = 'accelerating';
|
|
55
|
+
else if (growthRate > 5)
|
|
56
|
+
trend = 'steady';
|
|
57
|
+
else if (growthRate > -10)
|
|
58
|
+
trend = 'decelerating';
|
|
59
|
+
else
|
|
60
|
+
trend = 'declining';
|
|
61
|
+
const summary = {
|
|
62
|
+
totalEvents: totalRow.c,
|
|
63
|
+
eventsLast7d: last7d.c,
|
|
64
|
+
eventsLast30d: last30d.c,
|
|
65
|
+
avgDailyGrowth: avgDaily,
|
|
66
|
+
peakDay: peak.date,
|
|
67
|
+
peakDayCount: peak.newEvents,
|
|
68
|
+
growthRate,
|
|
69
|
+
trend,
|
|
70
|
+
};
|
|
71
|
+
// Prediction (simple linear extrapolation)
|
|
72
|
+
const recentDays = dataPoints.slice(-7);
|
|
73
|
+
const recentAvg = recentDays.length > 0
|
|
74
|
+
? recentDays.reduce((s, d) => s + d.newEvents, 0) / recentDays.length
|
|
75
|
+
: avgDaily;
|
|
76
|
+
const prediction = {
|
|
77
|
+
next7dEstimate: Math.round(recentAvg * 7),
|
|
78
|
+
next30dEstimate: Math.round(recentAvg * 30),
|
|
79
|
+
confidence: dataPoints.length >= 14 ? 0.8 : dataPoints.length >= 7 ? 0.6 : 0.4,
|
|
80
|
+
basedOnDays: dataPoints.length,
|
|
81
|
+
};
|
|
82
|
+
// ASCII Chart
|
|
83
|
+
const chart = renderGrowthChart(dataPoints, summary);
|
|
84
|
+
return {
|
|
85
|
+
project,
|
|
86
|
+
period: `${days}d`,
|
|
87
|
+
dataPoints,
|
|
88
|
+
summary,
|
|
89
|
+
prediction,
|
|
90
|
+
chart,
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
function renderGrowthChart(points, summary) {
|
|
94
|
+
if (points.length === 0)
|
|
95
|
+
return ' No data available.';
|
|
96
|
+
const maxEvents = Math.max(...points.map(p => p.newEvents), 1);
|
|
97
|
+
const chartHeight = 10;
|
|
98
|
+
const lines = [];
|
|
99
|
+
lines.push(` Memory Growth — ${summary.trend.toUpperCase()} (rate: ${summary.growthRate > 0 ? '+' : ''}${summary.growthRate}%)`);
|
|
100
|
+
lines.push('');
|
|
101
|
+
// Build chart rows
|
|
102
|
+
for (let row = chartHeight; row >= 1; row--) {
|
|
103
|
+
const threshold = (row / chartHeight) * maxEvents;
|
|
104
|
+
const label = row === chartHeight ? String(maxEvents).padStart(4) : row === 1 ? ' 1' : ' ';
|
|
105
|
+
let line = ` ${label} │`;
|
|
106
|
+
for (const p of points) {
|
|
107
|
+
if (p.newEvents >= threshold) {
|
|
108
|
+
line += ' █';
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
line += ' ';
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
lines.push(line);
|
|
115
|
+
}
|
|
116
|
+
// X axis
|
|
117
|
+
lines.push(` └${'─'.repeat(points.length * 2)}`);
|
|
118
|
+
// Date labels
|
|
119
|
+
if (points.length > 0) {
|
|
120
|
+
const first = points[0].date.slice(5);
|
|
121
|
+
const last = points[points.length - 1].date.slice(5);
|
|
122
|
+
lines.push(` ${first}${' '.repeat(Math.max(0, points.length * 2 - first.length - last.length))}${last}`);
|
|
123
|
+
}
|
|
124
|
+
lines.push('');
|
|
125
|
+
lines.push(` Total: ${summary.totalEvents} | Last 7d: ${summary.eventsLast7d} | Avg/day: ${summary.avgDailyGrowth}`);
|
|
126
|
+
return lines.join('\n');
|
|
127
|
+
}
|
|
128
|
+
function formatGrowthTrend(trend) {
|
|
129
|
+
const lines = [];
|
|
130
|
+
lines.push(`## Memory Growth — ${trend.project} (${trend.period})\n`);
|
|
131
|
+
lines.push(trend.chart);
|
|
132
|
+
lines.push('');
|
|
133
|
+
lines.push(`### Summary`);
|
|
134
|
+
lines.push(`| Metric | Value |`);
|
|
135
|
+
lines.push(`|--------|-------|`);
|
|
136
|
+
lines.push(`| Total events | ${trend.summary.totalEvents} |`);
|
|
137
|
+
lines.push(`| Last 7d | ${trend.summary.eventsLast7d} |`);
|
|
138
|
+
lines.push(`| Last 30d | ${trend.summary.eventsLast30d} |`);
|
|
139
|
+
lines.push(`| Avg daily | ${trend.summary.avgDailyGrowth} |`);
|
|
140
|
+
lines.push(`| Peak day | ${trend.summary.peakDay} (${trend.summary.peakDayCount}) |`);
|
|
141
|
+
lines.push(`| Growth rate | ${trend.summary.growthRate > 0 ? '+' : ''}${trend.summary.growthRate}% |`);
|
|
142
|
+
lines.push(`| Trend | ${trend.summary.trend} |`);
|
|
143
|
+
lines.push('');
|
|
144
|
+
lines.push(`### Prediction`);
|
|
145
|
+
lines.push(`- Next 7d: ~${trend.prediction.next7dEstimate} events`);
|
|
146
|
+
lines.push(`- Next 30d: ~${trend.prediction.next30dEstimate} events`);
|
|
147
|
+
lines.push(`- Confidence: ${Math.round(trend.prediction.confidence * 100)}% (${trend.prediction.basedOnDays} days of data)`);
|
|
148
|
+
return lines.join('\n');
|
|
149
|
+
}
|
|
150
|
+
//# sourceMappingURL=memory-growth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"memory-growth.js","sourceRoot":"","sources":["../../../../src/walls/06-memory/stores/memory-growth.ts"],"names":[],"mappings":";;AAqCA,kDAsGC;AA2CD,8CAqBC;AA3MD,mDAA6C;AAqC7C,SAA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,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -4032,6 +4032,69 @@ function doMemory() {
|
|
|
4032
4032
|
console.log();
|
|
4033
4033
|
return;
|
|
4034
4034
|
}
|
|
4035
|
+
if (sub === 'growth' || sub === 'gr') {
|
|
4036
|
+
const days = parseInt(args[2] || '30', 10);
|
|
4037
|
+
console.log(C.bold(` ── Memory Growth Trends (${days} days) ──\n`));
|
|
4038
|
+
try {
|
|
4039
|
+
const { computeGrowthTrends, formatGrowthTrend } = require('../../06-memory/stores/memory-growth');
|
|
4040
|
+
const { detectProject } = require('../setup/setup');
|
|
4041
|
+
const project = detectProject(cwd).name;
|
|
4042
|
+
const trend = computeGrowthTrends(project, days);
|
|
4043
|
+
console.log(formatGrowthTrend(trend));
|
|
4044
|
+
}
|
|
4045
|
+
catch (e) {
|
|
4046
|
+
console.log(C.warn(` Growth trends failed: ${e?.message || String(e)}`));
|
|
4047
|
+
}
|
|
4048
|
+
console.log();
|
|
4049
|
+
return;
|
|
4050
|
+
}
|
|
4051
|
+
if (sub === 'velocity' || sub === 'vel') {
|
|
4052
|
+
const days = parseInt(args[2] || '30', 10);
|
|
4053
|
+
console.log(C.bold(` ── Developer Velocity (${days} days) ──\n`));
|
|
4054
|
+
try {
|
|
4055
|
+
const { computeDeveloperVelocity, formatDeveloperVelocity } = require('../../06-memory/stores/developer-velocity');
|
|
4056
|
+
const { detectProject } = require('../setup/setup');
|
|
4057
|
+
const project = detectProject(cwd).name;
|
|
4058
|
+
const vel = computeDeveloperVelocity(project, days);
|
|
4059
|
+
console.log(formatDeveloperVelocity(vel));
|
|
4060
|
+
}
|
|
4061
|
+
catch (e) {
|
|
4062
|
+
console.log(C.warn(` Velocity failed: ${e?.message || String(e)}`));
|
|
4063
|
+
}
|
|
4064
|
+
console.log();
|
|
4065
|
+
return;
|
|
4066
|
+
}
|
|
4067
|
+
if (sub === 'errors' || sub === 'err') {
|
|
4068
|
+
const days = parseInt(args[2] || '30', 10);
|
|
4069
|
+
console.log(C.bold(` ── Error Trend Analysis (${days} days) ──\n`));
|
|
4070
|
+
try {
|
|
4071
|
+
const { computeErrorTrends, formatErrorTrend } = require('../../06-memory/stores/error-trends');
|
|
4072
|
+
const { detectProject } = require('../setup/setup');
|
|
4073
|
+
const project = detectProject(cwd).name;
|
|
4074
|
+
const trend = computeErrorTrends(project, days);
|
|
4075
|
+
console.log(formatErrorTrend(trend));
|
|
4076
|
+
}
|
|
4077
|
+
catch (e) {
|
|
4078
|
+
console.log(C.warn(` Error trends failed: ${e?.message || String(e)}`));
|
|
4079
|
+
}
|
|
4080
|
+
console.log();
|
|
4081
|
+
return;
|
|
4082
|
+
}
|
|
4083
|
+
if (sub === 'code-health' || sub === 'ch') {
|
|
4084
|
+
console.log(C.bold(' ── Code Health Score ──\n'));
|
|
4085
|
+
try {
|
|
4086
|
+
const { computeCodeHealth, formatCodeHealth } = require('../../06-memory/stores/code-health');
|
|
4087
|
+
const { detectProject } = require('../setup/setup');
|
|
4088
|
+
const project = detectProject(cwd).name;
|
|
4089
|
+
const health = computeCodeHealth(cwd, project);
|
|
4090
|
+
console.log(formatCodeHealth(health));
|
|
4091
|
+
}
|
|
4092
|
+
catch (e) {
|
|
4093
|
+
console.log(C.warn(` Code health failed: ${e?.message || String(e)}`));
|
|
4094
|
+
}
|
|
4095
|
+
console.log();
|
|
4096
|
+
return;
|
|
4097
|
+
}
|
|
4035
4098
|
console.log(C.bold(' Cell Memory'));
|
|
4036
4099
|
console.log(C.dim(' ──────────'));
|
|
4037
4100
|
console.log(C.dim(' cell memory search <query> Search memory events'));
|
|
@@ -4041,6 +4104,10 @@ function doMemory() {
|
|
|
4041
4104
|
console.log(C.dim(' cell memory verify Verify memory health'));
|
|
4042
4105
|
console.log(C.dim(' cell memory health Full memory health check'));
|
|
4043
4106
|
console.log(C.dim(' cell memory score Health score (0-100)'));
|
|
4107
|
+
console.log(C.dim(' cell memory growth [days] Memory growth trends'));
|
|
4108
|
+
console.log(C.dim(' cell memory velocity [days] Developer velocity'));
|
|
4109
|
+
console.log(C.dim(' cell memory errors [days] Error trend analysis'));
|
|
4110
|
+
console.log(C.dim(' cell memory code-health Code health score'));
|
|
4044
4111
|
console.log(C.dim(' cell memory summary [daily|weekly] Generate summary'));
|
|
4045
4112
|
console.log(C.dim(' cell memory insights [days] Proactive insights'));
|
|
4046
4113
|
console.log(C.dim(' cell memory chart [type] [days] Visual charts'));
|