fivocell 5.0.0 → 5.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/dist/__tests__/ci-reporter.test.d.ts +2 -0
- package/dist/__tests__/ci-reporter.test.d.ts.map +1 -0
- package/dist/__tests__/ci-reporter.test.js +109 -0
- package/dist/__tests__/ci-reporter.test.js.map +1 -0
- 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/ci-reporter.d.ts +68 -0
- package/dist/walls/06-memory/stores/ci-reporter.d.ts.map +1 -0
- package/dist/walls/06-memory/stores/ci-reporter.js +272 -0
- package/dist/walls/06-memory/stores/ci-reporter.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 +247 -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 +96 -0
- package/dist/walls/07-runtime/daemon/server.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +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,SAAgB,mBAAmB,CAAC,OAAe,EAAE,OAAe,EAAE;IACpE,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,qBAAqB;IACrB,MAAM,SAAS,GAAG,EAAE,CAAC,OAAO,CAAC;;;;GAI5B,CAAC,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAA2D,CAAC;IAEjF,yBAAyB;IACzB,MAAM,QAAQ,GAAG,EAAE,CAAC,OAAO,CAAC;;;;GAI3B,CAAC,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAyD,CAAC;IAE/E,MAAM,SAAS,GAA2C,EAAE,CAAC;IAC7D,KAAK,MAAM,CAAC,IAAI,QAAQ,EAAE,CAAC;QACzB,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC;YAAE,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;QAC/C,SAAS,CA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CAAC,CAAC;IACvG,KAAK,CAAC,IAAI,CAAC,aAAa,KAAK,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC,CAAC;IACjD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACf,KAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;IAC7B,KAAK,CAAC,IAAI,CAAC,eAAe,KAAK,CAAC,UAAU,CAAC,cAAc,SAAS,CAAC,CAAC;IACpE,KAAK,CAAC,IAAI,CAAC,gBAAgB,KAAK,CAAC,UAAU,CAAC,eAAe,SAAS,CAAC,CAAC;IACtE,KAAK,CAAC,IAAI,CAAC,iBAAiB,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,UAAU,CAAC,UAAU,GAAG,GAAG,CAAC,MAAM,KAAK,CAAC,UAAU,CAAC,WAAW,gBAAgB,CAAC,CAAC;IAC7H,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -88,6 +88,12 @@ function parseArgs(argv) {
|
|
|
88
88
|
}
|
|
89
89
|
const args = parseArgs(process.argv.slice(2));
|
|
90
90
|
const cmd = args[0] || '';
|
|
91
|
+
function getArg(name) {
|
|
92
|
+
const idx = args.indexOf(name);
|
|
93
|
+
if (idx === -1)
|
|
94
|
+
return null;
|
|
95
|
+
return args[idx + 1] || null;
|
|
96
|
+
}
|
|
91
97
|
// Module-level state for watch-editor (must be declared before switch)
|
|
92
98
|
let activeMonitor = null;
|
|
93
99
|
let monitorStateFile = null;
|
|
@@ -195,6 +201,9 @@ switch (cmd) {
|
|
|
195
201
|
case 'memory':
|
|
196
202
|
doMemory();
|
|
197
203
|
break;
|
|
204
|
+
case 'ci':
|
|
205
|
+
doCI();
|
|
206
|
+
break;
|
|
198
207
|
case 'cross-project':
|
|
199
208
|
doCrossProject();
|
|
200
209
|
break;
|
|
@@ -4032,6 +4041,69 @@ function doMemory() {
|
|
|
4032
4041
|
console.log();
|
|
4033
4042
|
return;
|
|
4034
4043
|
}
|
|
4044
|
+
if (sub === 'growth' || sub === 'gr') {
|
|
4045
|
+
const days = parseInt(args[2] || '30', 10);
|
|
4046
|
+
console.log(C.bold(` ── Memory Growth Trends (${days} days) ──\n`));
|
|
4047
|
+
try {
|
|
4048
|
+
const { computeGrowthTrends, formatGrowthTrend } = require('../../06-memory/stores/memory-growth');
|
|
4049
|
+
const { detectProject } = require('../setup/setup');
|
|
4050
|
+
const project = detectProject(cwd).name;
|
|
4051
|
+
const trend = computeGrowthTrends(project, days);
|
|
4052
|
+
console.log(formatGrowthTrend(trend));
|
|
4053
|
+
}
|
|
4054
|
+
catch (e) {
|
|
4055
|
+
console.log(C.warn(` Growth trends failed: ${e?.message || String(e)}`));
|
|
4056
|
+
}
|
|
4057
|
+
console.log();
|
|
4058
|
+
return;
|
|
4059
|
+
}
|
|
4060
|
+
if (sub === 'velocity' || sub === 'vel') {
|
|
4061
|
+
const days = parseInt(args[2] || '30', 10);
|
|
4062
|
+
console.log(C.bold(` ── Developer Velocity (${days} days) ──\n`));
|
|
4063
|
+
try {
|
|
4064
|
+
const { computeDeveloperVelocity, formatDeveloperVelocity } = require('../../06-memory/stores/developer-velocity');
|
|
4065
|
+
const { detectProject } = require('../setup/setup');
|
|
4066
|
+
const project = detectProject(cwd).name;
|
|
4067
|
+
const vel = computeDeveloperVelocity(project, days);
|
|
4068
|
+
console.log(formatDeveloperVelocity(vel));
|
|
4069
|
+
}
|
|
4070
|
+
catch (e) {
|
|
4071
|
+
console.log(C.warn(` Velocity failed: ${e?.message || String(e)}`));
|
|
4072
|
+
}
|
|
4073
|
+
console.log();
|
|
4074
|
+
return;
|
|
4075
|
+
}
|
|
4076
|
+
if (sub === 'errors' || sub === 'err') {
|
|
4077
|
+
const days = parseInt(args[2] || '30', 10);
|
|
4078
|
+
console.log(C.bold(` ── Error Trend Analysis (${days} days) ──\n`));
|
|
4079
|
+
try {
|
|
4080
|
+
const { computeErrorTrends, formatErrorTrend } = require('../../06-memory/stores/error-trends');
|
|
4081
|
+
const { detectProject } = require('../setup/setup');
|
|
4082
|
+
const project = detectProject(cwd).name;
|
|
4083
|
+
const trend = computeErrorTrends(project, days);
|
|
4084
|
+
console.log(formatErrorTrend(trend));
|
|
4085
|
+
}
|
|
4086
|
+
catch (e) {
|
|
4087
|
+
console.log(C.warn(` Error trends failed: ${e?.message || String(e)}`));
|
|
4088
|
+
}
|
|
4089
|
+
console.log();
|
|
4090
|
+
return;
|
|
4091
|
+
}
|
|
4092
|
+
if (sub === 'code-health' || sub === 'ch') {
|
|
4093
|
+
console.log(C.bold(' ── Code Health Score ──\n'));
|
|
4094
|
+
try {
|
|
4095
|
+
const { computeCodeHealth, formatCodeHealth } = require('../../06-memory/stores/code-health');
|
|
4096
|
+
const { detectProject } = require('../setup/setup');
|
|
4097
|
+
const project = detectProject(cwd).name;
|
|
4098
|
+
const health = computeCodeHealth(cwd, project);
|
|
4099
|
+
console.log(formatCodeHealth(health));
|
|
4100
|
+
}
|
|
4101
|
+
catch (e) {
|
|
4102
|
+
console.log(C.warn(` Code health failed: ${e?.message || String(e)}`));
|
|
4103
|
+
}
|
|
4104
|
+
console.log();
|
|
4105
|
+
return;
|
|
4106
|
+
}
|
|
4035
4107
|
console.log(C.bold(' Cell Memory'));
|
|
4036
4108
|
console.log(C.dim(' ──────────'));
|
|
4037
4109
|
console.log(C.dim(' cell memory search <query> Search memory events'));
|
|
@@ -4041,6 +4113,10 @@ function doMemory() {
|
|
|
4041
4113
|
console.log(C.dim(' cell memory verify Verify memory health'));
|
|
4042
4114
|
console.log(C.dim(' cell memory health Full memory health check'));
|
|
4043
4115
|
console.log(C.dim(' cell memory score Health score (0-100)'));
|
|
4116
|
+
console.log(C.dim(' cell memory growth [days] Memory growth trends'));
|
|
4117
|
+
console.log(C.dim(' cell memory velocity [days] Developer velocity'));
|
|
4118
|
+
console.log(C.dim(' cell memory errors [days] Error trend analysis'));
|
|
4119
|
+
console.log(C.dim(' cell memory code-health Code health score'));
|
|
4044
4120
|
console.log(C.dim(' cell memory summary [daily|weekly] Generate summary'));
|
|
4045
4121
|
console.log(C.dim(' cell memory insights [days] Proactive insights'));
|
|
4046
4122
|
console.log(C.dim(' cell memory chart [type] [days] Visual charts'));
|
|
@@ -4056,4 +4132,175 @@ function doMemory() {
|
|
|
4056
4132
|
console.log(C.dim(' cell memory stats Show memory stats'));
|
|
4057
4133
|
console.log();
|
|
4058
4134
|
}
|
|
4135
|
+
function doCI() {
|
|
4136
|
+
const sub = args[1] || '';
|
|
4137
|
+
const cwd = process.cwd();
|
|
4138
|
+
if (sub === 'report' || sub === 'r') {
|
|
4139
|
+
const buildId = getArg('--build-id') || `local-${Date.now()}`;
|
|
4140
|
+
const status = getArg('--status') || 'success';
|
|
4141
|
+
const stage = getArg('--stage') || 'build';
|
|
4142
|
+
const commit = getArg('--commit') || '';
|
|
4143
|
+
const message = getArg('--message') || '';
|
|
4144
|
+
const author = getArg('--author') || '';
|
|
4145
|
+
const platform = getArg('--platform') || 'local';
|
|
4146
|
+
const branch = getArg('--branch') || '';
|
|
4147
|
+
const duration = parseInt(getArg('--duration') || '0', 10);
|
|
4148
|
+
const logSnippet = getArg('--log') || '';
|
|
4149
|
+
console.log(C.bold(` ── CI Report Build ──\n`));
|
|
4150
|
+
try {
|
|
4151
|
+
const { reportCIBuild } = require('../../06-memory/stores/ci-reporter');
|
|
4152
|
+
const { detectProject } = require('../setup/setup');
|
|
4153
|
+
const project = detectProject(cwd).name;
|
|
4154
|
+
const id = reportCIBuild({
|
|
4155
|
+
project,
|
|
4156
|
+
branch,
|
|
4157
|
+
buildId,
|
|
4158
|
+
status: status,
|
|
4159
|
+
duration,
|
|
4160
|
+
stage,
|
|
4161
|
+
commitHash: commit,
|
|
4162
|
+
commitMessage: message,
|
|
4163
|
+
author,
|
|
4164
|
+
timestamp: new Date().toISOString(),
|
|
4165
|
+
logSnippet,
|
|
4166
|
+
ciPlatform: platform,
|
|
4167
|
+
});
|
|
4168
|
+
console.log(C.success(` Build reported (event #${id}): ${status} [${stage}]`));
|
|
4169
|
+
}
|
|
4170
|
+
catch (e) {
|
|
4171
|
+
console.log(C.warn(` Report failed: ${e?.message || String(e)}`));
|
|
4172
|
+
}
|
|
4173
|
+
console.log();
|
|
4174
|
+
return;
|
|
4175
|
+
}
|
|
4176
|
+
if (sub === 'report-test' || sub === 'rt') {
|
|
4177
|
+
const buildId = getArg('--build-id') || `local-${Date.now()}`;
|
|
4178
|
+
const total = parseInt(getArg('--total') || '0', 10);
|
|
4179
|
+
const passed = parseInt(getArg('--passed') || '0', 10);
|
|
4180
|
+
const failed = parseInt(getArg('--failed') || '0', 10);
|
|
4181
|
+
const skipped = parseInt(getArg('--skipped') || '0', 10);
|
|
4182
|
+
const duration = parseInt(getArg('--duration') || '0', 10);
|
|
4183
|
+
const coverage = getArg('--coverage') ? parseFloat(getArg('--coverage')) : undefined;
|
|
4184
|
+
const branch = getArg('--branch') || '';
|
|
4185
|
+
console.log(C.bold(` ── CI Report Tests ──\n`));
|
|
4186
|
+
try {
|
|
4187
|
+
const { reportCITest } = require('../../06-memory/stores/ci-reporter');
|
|
4188
|
+
const { detectProject } = require('../setup/setup');
|
|
4189
|
+
const project = detectProject(cwd).name;
|
|
4190
|
+
const failedTests = [];
|
|
4191
|
+
const id = reportCITest({
|
|
4192
|
+
project,
|
|
4193
|
+
branch,
|
|
4194
|
+
buildId,
|
|
4195
|
+
totalTests: total,
|
|
4196
|
+
passed,
|
|
4197
|
+
failed,
|
|
4198
|
+
skipped,
|
|
4199
|
+
duration,
|
|
4200
|
+
failedTests,
|
|
4201
|
+
coverage,
|
|
4202
|
+
timestamp: new Date().toISOString(),
|
|
4203
|
+
});
|
|
4204
|
+
const color = failed > 0 ? C.warn : C.success;
|
|
4205
|
+
console.log(color(` Tests reported (event #${id}): ${passed}/${total} passed`));
|
|
4206
|
+
}
|
|
4207
|
+
catch (e) {
|
|
4208
|
+
console.log(C.warn(` Report failed: ${e?.message || String(e)}`));
|
|
4209
|
+
}
|
|
4210
|
+
console.log();
|
|
4211
|
+
return;
|
|
4212
|
+
}
|
|
4213
|
+
if (sub === 'report-deploy' || sub === 'rd') {
|
|
4214
|
+
const env = getArg('--env') || 'local';
|
|
4215
|
+
const status = getArg('--status') || 'success';
|
|
4216
|
+
const version = getArg('--version') || '0.0.0';
|
|
4217
|
+
const duration = parseInt(getArg('--duration') || '0', 10);
|
|
4218
|
+
console.log(C.bold(` ── CI Report Deploy ──\n`));
|
|
4219
|
+
try {
|
|
4220
|
+
const { reportCIDeploy } = require('../../06-memory/stores/ci-reporter');
|
|
4221
|
+
const { detectProject } = require('../setup/setup');
|
|
4222
|
+
const project = detectProject(cwd).name;
|
|
4223
|
+
const id = reportCIDeploy({
|
|
4224
|
+
project,
|
|
4225
|
+
environment: env,
|
|
4226
|
+
status: status,
|
|
4227
|
+
version,
|
|
4228
|
+
duration,
|
|
4229
|
+
timestamp: new Date().toISOString(),
|
|
4230
|
+
});
|
|
4231
|
+
const color = status === 'success' ? C.success : C.warn;
|
|
4232
|
+
console.log(color(` Deploy reported (event #${id}): ${status} ${version} → ${env}`));
|
|
4233
|
+
}
|
|
4234
|
+
catch (e) {
|
|
4235
|
+
console.log(C.warn(` Report failed: ${e?.message || String(e)}`));
|
|
4236
|
+
}
|
|
4237
|
+
console.log();
|
|
4238
|
+
return;
|
|
4239
|
+
}
|
|
4240
|
+
if (sub === 'summary' || sub === 's') {
|
|
4241
|
+
const days = parseInt(args[2] || '30', 10);
|
|
4242
|
+
console.log(C.bold(` ── CI/CD Summary (${days} days) ──\n`));
|
|
4243
|
+
try {
|
|
4244
|
+
const { getCISummary, formatCISummary } = require('../../06-memory/stores/ci-reporter');
|
|
4245
|
+
const { detectProject } = require('../setup/setup');
|
|
4246
|
+
const project = detectProject(cwd).name;
|
|
4247
|
+
const summary = getCISummary(project, days);
|
|
4248
|
+
console.log(formatCISummary(summary));
|
|
4249
|
+
}
|
|
4250
|
+
catch (e) {
|
|
4251
|
+
console.log(C.warn(` CI summary failed: ${e?.message || String(e)}`));
|
|
4252
|
+
}
|
|
4253
|
+
console.log();
|
|
4254
|
+
return;
|
|
4255
|
+
}
|
|
4256
|
+
if (sub === 'failures' || sub === 'f') {
|
|
4257
|
+
const days = parseInt(args[2] || '30', 10);
|
|
4258
|
+
console.log(C.bold(` ── CI Failure Patterns (${days} days) ──\n`));
|
|
4259
|
+
try {
|
|
4260
|
+
const { detectCIFailurePatterns } = require('../../06-memory/stores/ci-reporter');
|
|
4261
|
+
const { detectProject } = require('../setup/setup');
|
|
4262
|
+
const project = detectProject(cwd).name;
|
|
4263
|
+
const patterns = detectCIFailurePatterns(project, days);
|
|
4264
|
+
if (patterns.length === 0) {
|
|
4265
|
+
console.log(C.dim(' No failure patterns detected.'));
|
|
4266
|
+
}
|
|
4267
|
+
else {
|
|
4268
|
+
for (const p of patterns) {
|
|
4269
|
+
const sevColor = p.severity === 'critical' ? C.warn : p.severity === 'warning' ? C.primary : C.dim;
|
|
4270
|
+
console.log(` ${sevColor(`[${p.severity}]`)} ${p.pattern}`);
|
|
4271
|
+
console.log(C.dim(` Count: ${p.count} | Branches: ${p.affectedBranches.join(', ')}`));
|
|
4272
|
+
console.log(C.dim(` Suggestion: ${p.suggestion}`));
|
|
4273
|
+
}
|
|
4274
|
+
}
|
|
4275
|
+
}
|
|
4276
|
+
catch (e) {
|
|
4277
|
+
console.log(C.warn(` CI failures failed: ${e?.message || String(e)}`));
|
|
4278
|
+
}
|
|
4279
|
+
console.log();
|
|
4280
|
+
return;
|
|
4281
|
+
}
|
|
4282
|
+
console.log(C.bold(' Cell CI/CD'));
|
|
4283
|
+
console.log(C.dim(' ──────────'));
|
|
4284
|
+
console.log(C.dim(' cell ci report Report build result'));
|
|
4285
|
+
console.log(C.dim(' cell ci report-test Report test results'));
|
|
4286
|
+
console.log(C.dim(' cell ci report-deploy Report deployment'));
|
|
4287
|
+
console.log(C.dim(' cell ci summary [days] CI/CD summary'));
|
|
4288
|
+
console.log(C.dim(' cell ci failures [days] Failure patterns'));
|
|
4289
|
+
console.log(C.dim(''));
|
|
4290
|
+
console.log(C.dim(' Options:'));
|
|
4291
|
+
console.log(C.dim(' --build-id ID Build identifier'));
|
|
4292
|
+
console.log(C.dim(' --status STATUS success|failure|cancelled'));
|
|
4293
|
+
console.log(C.dim(' --stage STAGE build|test|lint|deploy'));
|
|
4294
|
+
console.log(C.dim(' --commit HASH Commit hash'));
|
|
4295
|
+
console.log(C.dim(' --branch NAME Branch name'));
|
|
4296
|
+
console.log(C.dim(' --platform NAME github-actions|gitlab-ci|jenkins|local'));
|
|
4297
|
+
console.log(C.dim(' --duration MS Build duration in ms'));
|
|
4298
|
+
console.log(C.dim(' --env ENV staging|production|preview'));
|
|
4299
|
+
console.log(C.dim(' --version VER Version string'));
|
|
4300
|
+
console.log(C.dim(' --total N Total tests'));
|
|
4301
|
+
console.log(C.dim(' --passed N Passed tests'));
|
|
4302
|
+
console.log(C.dim(' --failed N Failed tests'));
|
|
4303
|
+
console.log(C.dim(' --coverage N Coverage percentage'));
|
|
4304
|
+
console.log();
|
|
4305
|
+
}
|
|
4059
4306
|
//# sourceMappingURL=cli.js.map
|