fivocell 4.8.0 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/__tests__/auto-handoff.test.d.ts +2 -0
- package/dist/__tests__/auto-handoff.test.d.ts.map +1 -0
- package/dist/__tests__/auto-handoff.test.js +65 -0
- package/dist/__tests__/auto-handoff.test.js.map +1 -0
- package/dist/__tests__/context-compression.test.d.ts +2 -0
- package/dist/__tests__/context-compression.test.d.ts.map +1 -0
- package/dist/__tests__/context-compression.test.js +77 -0
- package/dist/__tests__/context-compression.test.js.map +1 -0
- package/dist/__tests__/memory-automation.test.d.ts +2 -0
- package/dist/__tests__/memory-automation.test.d.ts.map +1 -0
- package/dist/__tests__/memory-automation.test.js +136 -0
- package/dist/__tests__/memory-automation.test.js.map +1 -0
- package/dist/__tests__/memory-digest.test.d.ts +2 -0
- package/dist/__tests__/memory-digest.test.d.ts.map +1 -0
- package/dist/__tests__/memory-digest.test.js +20 -0
- package/dist/__tests__/memory-digest.test.js.map +1 -0
- package/dist/__tests__/memory-health.test.d.ts +2 -0
- package/dist/__tests__/memory-health.test.d.ts.map +1 -0
- package/dist/__tests__/memory-health.test.js +66 -0
- package/dist/__tests__/memory-health.test.js.map +1 -0
- package/dist/__tests__/semantic-memory.test.d.ts +2 -0
- package/dist/__tests__/semantic-memory.test.d.ts.map +1 -0
- package/dist/__tests__/semantic-memory.test.js +31 -0
- package/dist/__tests__/semantic-memory.test.js.map +1 -0
- package/dist/__tests__/smart-recommendations.test.d.ts +2 -0
- package/dist/__tests__/smart-recommendations.test.d.ts.map +1 -0
- package/dist/__tests__/smart-recommendations.test.js +74 -0
- package/dist/__tests__/smart-recommendations.test.js.map +1 -0
- package/dist/walls/06-memory/automation/memory-automation.d.ts +49 -0
- package/dist/walls/06-memory/automation/memory-automation.d.ts.map +1 -0
- package/dist/walls/06-memory/automation/memory-automation.js +396 -0
- package/dist/walls/06-memory/automation/memory-automation.js.map +1 -0
- package/dist/walls/06-memory/stores/auto-handoff.d.ts +13 -0
- package/dist/walls/06-memory/stores/auto-handoff.d.ts.map +1 -0
- package/dist/walls/06-memory/stores/auto-handoff.js +149 -0
- package/dist/walls/06-memory/stores/auto-handoff.js.map +1 -0
- package/dist/walls/06-memory/stores/context-compression.d.ts +33 -0
- package/dist/walls/06-memory/stores/context-compression.d.ts.map +1 -0
- package/dist/walls/06-memory/stores/context-compression.js +265 -0
- package/dist/walls/06-memory/stores/context-compression.js.map +1 -0
- package/dist/walls/06-memory/stores/memory-digest.d.ts +13 -0
- package/dist/walls/06-memory/stores/memory-digest.d.ts.map +1 -0
- package/dist/walls/06-memory/stores/memory-digest.js +44 -0
- package/dist/walls/06-memory/stores/memory-digest.js.map +1 -0
- package/dist/walls/06-memory/stores/memory-health.d.ts +32 -0
- package/dist/walls/06-memory/stores/memory-health.d.ts.map +1 -0
- package/dist/walls/06-memory/stores/memory-health.js +221 -0
- package/dist/walls/06-memory/stores/memory-health.js.map +1 -0
- package/dist/walls/06-memory/stores/semantic-memory.d.ts +23 -0
- package/dist/walls/06-memory/stores/semantic-memory.d.ts.map +1 -0
- package/dist/walls/06-memory/stores/semantic-memory.js +119 -0
- package/dist/walls/06-memory/stores/semantic-memory.js.map +1 -0
- package/dist/walls/06-memory/stores/smart-recommendations.d.ts +30 -0
- package/dist/walls/06-memory/stores/smart-recommendations.d.ts.map +1 -0
- package/dist/walls/06-memory/stores/smart-recommendations.js +222 -0
- package/dist/walls/06-memory/stores/smart-recommendations.js.map +1 -0
- package/dist/walls/06-memory/stores/weekly-report.js +1 -1
- package/dist/walls/07-runtime/cli/cli.js +165 -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 +64 -0
- package/dist/walls/07-runtime/daemon/server.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export interface CompressedContext {
|
|
2
|
+
project: string;
|
|
3
|
+
mode: 'compact' | 'full' | 'topic';
|
|
4
|
+
tokenEstimate: number;
|
|
5
|
+
sections: ContextSection[];
|
|
6
|
+
compressedAt: string;
|
|
7
|
+
summary: string;
|
|
8
|
+
}
|
|
9
|
+
export interface ContextSection {
|
|
10
|
+
type: 'overview' | 'recent' | 'decisions' | 'errors' | 'fixes' | 'patterns' | 'handoff' | 'recommendations' | 'files' | 'topics';
|
|
11
|
+
title: string;
|
|
12
|
+
content: string;
|
|
13
|
+
wordCount: number;
|
|
14
|
+
importance: number;
|
|
15
|
+
compressed: boolean;
|
|
16
|
+
}
|
|
17
|
+
export interface CompressionOptions {
|
|
18
|
+
project: string;
|
|
19
|
+
mode?: 'compact' | 'full' | 'topic';
|
|
20
|
+
topic?: string;
|
|
21
|
+
maxWords?: number;
|
|
22
|
+
maxSections?: number;
|
|
23
|
+
includeHandoff?: boolean;
|
|
24
|
+
includeRecommendations?: boolean;
|
|
25
|
+
includeFiles?: boolean;
|
|
26
|
+
days?: number;
|
|
27
|
+
}
|
|
28
|
+
export declare function compressContext(options: CompressionOptions): CompressedContext;
|
|
29
|
+
export declare function compressToMinimal(project: string): CompressedContext;
|
|
30
|
+
export declare function compressForAITool(project: string, tool: string): CompressedContext;
|
|
31
|
+
export declare function formatCompressedContext(ctx: CompressedContext): string;
|
|
32
|
+
export declare function estimateTokens(text: string): number;
|
|
33
|
+
//# sourceMappingURL=context-compression.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-compression.d.ts","sourceRoot":"","sources":["../../../../src/walls/06-memory/stores/context-compression.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,SAAS,GAAG,MAAM,GAAG,OAAO,CAAC;IACnC,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,cAAc,EAAE,CAAC;IAC3B,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,UAAU,GAAG,QAAQ,GAAG,WAAW,GAAG,QAAQ,GAAG,OAAO,GAAG,UAAU,GAAG,SAAS,GAAG,iBAAiB,GAAG,OAAO,GAAG,QAAQ,CAAC;IACjI,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,SAAS,GAAG,MAAM,GAAG,OAAO,CAAC;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,eAAe,CAAC,OAAO,EAAE,kBAAkB,GAAG,iBAAiB,CA8N9E;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,iBAAiB,CAEpE;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,iBAAiB,CAWlF;AAED,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,iBAAiB,GAAG,MAAM,CAYtE;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEnD"}
|
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.compressContext = compressContext;
|
|
4
|
+
exports.compressToMinimal = compressToMinimal;
|
|
5
|
+
exports.compressForAITool = compressForAITool;
|
|
6
|
+
exports.formatCompressedContext = formatCompressedContext;
|
|
7
|
+
exports.estimateTokens = estimateTokens;
|
|
8
|
+
const database_1 = require("../database/database");
|
|
9
|
+
function compressContext(options) {
|
|
10
|
+
const db = (0, database_1.getDb)();
|
|
11
|
+
const mode = options.mode || 'compact';
|
|
12
|
+
const maxWords = options.maxWords || getDefaultMaxWords(mode);
|
|
13
|
+
const days = options.days || getDefaultDays(mode);
|
|
14
|
+
const since = new Date(Date.now() - days * 86400000).toISOString();
|
|
15
|
+
const sections = [];
|
|
16
|
+
// Overview
|
|
17
|
+
const totalRow = db.prepare('SELECT COUNT(*) as c FROM memory_events WHERE project = ?').get(options.project);
|
|
18
|
+
const recentRow = db.prepare('SELECT COUNT(*) as c FROM memory_events WHERE project = ? AND created_at >= ?').get(options.project, since);
|
|
19
|
+
sections.push({
|
|
20
|
+
type: 'overview',
|
|
21
|
+
title: 'Overview',
|
|
22
|
+
content: `${totalRow.c} total memories, ${recentRow.c} in last ${days}d`,
|
|
23
|
+
wordCount: 12,
|
|
24
|
+
importance: 10,
|
|
25
|
+
compressed: true,
|
|
26
|
+
});
|
|
27
|
+
// Recent high-importance events
|
|
28
|
+
const recentEvents = db.prepare(`
|
|
29
|
+
SELECT type, summary, importance, topic, created_at FROM memory_events
|
|
30
|
+
WHERE project = ? AND created_at >= ?
|
|
31
|
+
ORDER BY importance DESC, created_at DESC
|
|
32
|
+
LIMIT ?
|
|
33
|
+
`).all(options.project, since, mode === 'compact' ? 10 : 25);
|
|
34
|
+
if (recentEvents.length > 0) {
|
|
35
|
+
const lines = recentEvents.map(e => {
|
|
36
|
+
const age = formatAge(e.created_at);
|
|
37
|
+
const topic = e.topic ? `[${e.topic}]` : '';
|
|
38
|
+
return `- [${e.type}]${topic} ${e.summary.slice(0, 100)} (${age})`;
|
|
39
|
+
});
|
|
40
|
+
sections.push({
|
|
41
|
+
type: 'recent',
|
|
42
|
+
title: 'Recent Activity',
|
|
43
|
+
content: lines.join('\n'),
|
|
44
|
+
wordCount: lines.length * 8,
|
|
45
|
+
importance: 9,
|
|
46
|
+
compressed: true,
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
// Decisions
|
|
50
|
+
const decisions = db.prepare(`
|
|
51
|
+
SELECT summary, topic, created_at FROM memory_events
|
|
52
|
+
WHERE project = ? AND type = 'decision' AND created_at >= ?
|
|
53
|
+
ORDER BY importance DESC, created_at DESC LIMIT ?
|
|
54
|
+
`).all(options.project, since, mode === 'compact' ? 5 : 15);
|
|
55
|
+
if (decisions.length > 0) {
|
|
56
|
+
const lines = decisions.map(d => `- ${d.summary.slice(0, 120)}`);
|
|
57
|
+
sections.push({
|
|
58
|
+
type: 'decisions',
|
|
59
|
+
title: 'Key Decisions',
|
|
60
|
+
content: lines.join('\n'),
|
|
61
|
+
wordCount: lines.length * 6,
|
|
62
|
+
importance: 9,
|
|
63
|
+
compressed: true,
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
// Errors
|
|
67
|
+
const errors = db.prepare(`
|
|
68
|
+
SELECT summary, topic, importance, created_at FROM memory_events
|
|
69
|
+
WHERE project = ? AND type = 'error' AND created_at >= ?
|
|
70
|
+
ORDER BY importance DESC, created_at DESC LIMIT ?
|
|
71
|
+
`).all(options.project, since, mode === 'compact' ? 5 : 15);
|
|
72
|
+
if (errors.length > 0) {
|
|
73
|
+
const lines = errors.map(e => `- [${e.importance}/10] ${e.summary.slice(0, 100)}`);
|
|
74
|
+
sections.push({
|
|
75
|
+
type: 'errors',
|
|
76
|
+
title: 'Errors',
|
|
77
|
+
content: lines.join('\n'),
|
|
78
|
+
wordCount: lines.length * 6,
|
|
79
|
+
importance: 8,
|
|
80
|
+
compressed: true,
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
// Fixes
|
|
84
|
+
const fixes = db.prepare(`
|
|
85
|
+
SELECT summary, topic, created_at FROM memory_events
|
|
86
|
+
WHERE project = ? AND type = 'fix' AND created_at >= ?
|
|
87
|
+
ORDER BY importance DESC, created_at DESC LIMIT ?
|
|
88
|
+
`).all(options.project, since, mode === 'compact' ? 5 : 15);
|
|
89
|
+
if (fixes.length > 0) {
|
|
90
|
+
const lines = fixes.map(f => `- ${f.summary.slice(0, 100)}`);
|
|
91
|
+
sections.push({
|
|
92
|
+
type: 'fixes',
|
|
93
|
+
title: 'Fixes Applied',
|
|
94
|
+
content: lines.join('\n'),
|
|
95
|
+
wordCount: lines.length * 5,
|
|
96
|
+
importance: 7,
|
|
97
|
+
compressed: true,
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
// Patterns
|
|
101
|
+
if (mode === 'full') {
|
|
102
|
+
const patterns = db.prepare(`
|
|
103
|
+
SELECT pattern, category, importance, confidence FROM memory_patterns
|
|
104
|
+
WHERE project = ?
|
|
105
|
+
ORDER BY importance DESC, confidence DESC LIMIT 10
|
|
106
|
+
`).all(options.project);
|
|
107
|
+
if (patterns.length > 0) {
|
|
108
|
+
const lines = patterns.map(p => `- [${p.category}] ${p.pattern.slice(0, 80)} (imp:${p.importance} conf:${p.confidence})`);
|
|
109
|
+
sections.push({
|
|
110
|
+
type: 'patterns',
|
|
111
|
+
title: 'Learned Patterns',
|
|
112
|
+
content: lines.join('\n'),
|
|
113
|
+
wordCount: lines.length * 8,
|
|
114
|
+
importance: 7,
|
|
115
|
+
compressed: true,
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
// Handoff
|
|
120
|
+
if (options.includeHandoff !== false) {
|
|
121
|
+
try {
|
|
122
|
+
const { getCurrentHandoff } = require('../handoff/handoff-store');
|
|
123
|
+
const handoff = getCurrentHandoff(options.project);
|
|
124
|
+
if (handoff?.content) {
|
|
125
|
+
const handoffContent = handoff.content.slice(0, 500);
|
|
126
|
+
sections.push({
|
|
127
|
+
type: 'handoff',
|
|
128
|
+
title: 'Current Handoff',
|
|
129
|
+
content: handoffContent,
|
|
130
|
+
wordCount: handoffContent.split(/\s+/).length,
|
|
131
|
+
importance: 8,
|
|
132
|
+
compressed: handoff.content.length > 500,
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
catch { }
|
|
137
|
+
}
|
|
138
|
+
// Recommendations
|
|
139
|
+
if (options.includeRecommendations !== false && mode !== 'compact') {
|
|
140
|
+
try {
|
|
141
|
+
const { generateSmartRecommendations } = require('./smart-recommendations');
|
|
142
|
+
const recs = generateSmartRecommendations(options.project);
|
|
143
|
+
if (recs.length > 0) {
|
|
144
|
+
const lines = recs.slice(0, 5).map((r) => `- [${r.priority}] ${r.title}`);
|
|
145
|
+
sections.push({
|
|
146
|
+
type: 'recommendations',
|
|
147
|
+
title: 'Recommendations',
|
|
148
|
+
content: lines.join('\n'),
|
|
149
|
+
wordCount: lines.length * 6,
|
|
150
|
+
importance: 6,
|
|
151
|
+
compressed: true,
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
catch { }
|
|
156
|
+
}
|
|
157
|
+
// Topic filter
|
|
158
|
+
if (options.topic) {
|
|
159
|
+
const topicEvents = db.prepare(`
|
|
160
|
+
SELECT type, summary, importance, created_at FROM memory_events
|
|
161
|
+
WHERE project = ? AND topic LIKE ? AND created_at >= ?
|
|
162
|
+
ORDER BY importance DESC, created_at DESC LIMIT 20
|
|
163
|
+
`).all(options.project, `%${options.topic}%`, since);
|
|
164
|
+
if (topicEvents.length > 0) {
|
|
165
|
+
const lines = topicEvents.map(e => `- [${e.type}] ${e.summary.slice(0, 100)}`);
|
|
166
|
+
sections.push({
|
|
167
|
+
type: 'topics',
|
|
168
|
+
title: `Topic: ${options.topic}`,
|
|
169
|
+
content: lines.join('\n'),
|
|
170
|
+
wordCount: lines.length * 8,
|
|
171
|
+
importance: 8,
|
|
172
|
+
compressed: true,
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
// Limit sections
|
|
177
|
+
const maxSections = options.maxSections || getDefaultMaxSections(mode);
|
|
178
|
+
const sorted = sections.sort((a, b) => b.importance - a.importance).slice(0, maxSections);
|
|
179
|
+
// Trim to max words
|
|
180
|
+
let totalWords = 0;
|
|
181
|
+
const trimmed = [];
|
|
182
|
+
for (const s of sorted) {
|
|
183
|
+
if (totalWords + s.wordCount > maxWords)
|
|
184
|
+
break;
|
|
185
|
+
trimmed.push(s);
|
|
186
|
+
totalWords += s.wordCount;
|
|
187
|
+
}
|
|
188
|
+
const tokenEstimate = Math.ceil(totalWords * 1.3);
|
|
189
|
+
const summary = `${trimmed.length} sections, ~${tokenEstimate} tokens`;
|
|
190
|
+
return {
|
|
191
|
+
project: options.project,
|
|
192
|
+
mode,
|
|
193
|
+
tokenEstimate,
|
|
194
|
+
sections: trimmed,
|
|
195
|
+
compressedAt: new Date().toISOString(),
|
|
196
|
+
summary,
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
function compressToMinimal(project) {
|
|
200
|
+
return compressContext({ project, mode: 'compact', maxWords: 500, maxSections: 3, includeHandoff: false, includeRecommendations: false, includeFiles: false });
|
|
201
|
+
}
|
|
202
|
+
function compressForAITool(project, tool) {
|
|
203
|
+
const profiles = {
|
|
204
|
+
cursor: { mode: 'compact', maxWords: 1500, maxSections: 5, includeHandoff: true, includeRecommendations: false },
|
|
205
|
+
copilot: { mode: 'compact', maxWords: 1000, maxSections: 4, includeHandoff: true, includeRecommendations: false },
|
|
206
|
+
'claude-code': { mode: 'full', maxWords: 4000, maxSections: 8, includeHandoff: true, includeRecommendations: true },
|
|
207
|
+
'opencode': { mode: 'full', maxWords: 3000, maxSections: 7, includeHandoff: true, includeRecommendations: true },
|
|
208
|
+
windsurf: { mode: 'compact', maxWords: 2000, maxSections: 5, includeHandoff: true, includeRecommendations: false },
|
|
209
|
+
aider: { mode: 'compact', maxWords: 1500, maxSections: 5, includeHandoff: true, includeRecommendations: false },
|
|
210
|
+
};
|
|
211
|
+
const opts = profiles[tool] || profiles['opencode'];
|
|
212
|
+
return compressContext({ project, ...opts });
|
|
213
|
+
}
|
|
214
|
+
function formatCompressedContext(ctx) {
|
|
215
|
+
const lines = [];
|
|
216
|
+
lines.push(`## Context (${ctx.mode}) — ${ctx.project}`);
|
|
217
|
+
lines.push(`> ${ctx.summary}\n`);
|
|
218
|
+
for (const s of ctx.sections) {
|
|
219
|
+
lines.push(`### ${s.title}`);
|
|
220
|
+
lines.push(s.content);
|
|
221
|
+
lines.push('');
|
|
222
|
+
}
|
|
223
|
+
return lines.join('\n');
|
|
224
|
+
}
|
|
225
|
+
function estimateTokens(text) {
|
|
226
|
+
return Math.ceil(text.split(/\s+/).length * 1.3);
|
|
227
|
+
}
|
|
228
|
+
function getDefaultMaxWords(mode) {
|
|
229
|
+
switch (mode) {
|
|
230
|
+
case 'compact': return 1500;
|
|
231
|
+
case 'full': return 5000;
|
|
232
|
+
case 'topic': return 2000;
|
|
233
|
+
default: return 1500;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
function getDefaultDays(mode) {
|
|
237
|
+
switch (mode) {
|
|
238
|
+
case 'compact': return 7;
|
|
239
|
+
case 'full': return 30;
|
|
240
|
+
case 'topic': return 14;
|
|
241
|
+
default: return 7;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
function getDefaultMaxSections(mode) {
|
|
245
|
+
switch (mode) {
|
|
246
|
+
case 'compact': return 5;
|
|
247
|
+
case 'full': return 10;
|
|
248
|
+
case 'topic': return 6;
|
|
249
|
+
default: return 5;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
function formatAge(dateStr) {
|
|
253
|
+
const ms = Date.now() - new Date(dateStr).getTime();
|
|
254
|
+
const hours = Math.round(ms / 3600000);
|
|
255
|
+
if (hours < 1)
|
|
256
|
+
return 'just now';
|
|
257
|
+
if (hours < 24)
|
|
258
|
+
return `${hours}h`;
|
|
259
|
+
const days = Math.round(hours / 24);
|
|
260
|
+
if (days < 7)
|
|
261
|
+
return `${days}d`;
|
|
262
|
+
const weeks = Math.round(days / 7);
|
|
263
|
+
return `${weeks}w`;
|
|
264
|
+
}
|
|
265
|
+
//# sourceMappingURL=context-compression.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-compression.js","sourceRoot":"","sources":["../../../../src/walls/06-memory/stores/context-compression.ts"],"names":[],"mappings":";;AAgCA,0CA8NC;AAED,8CAEC;AAED,8CAWC;AAED,0DAYC;AAED,wCAEC;AAjSD,mDAA6C;AAgC7C,SAAgB,eAAe,CAAC,OAA2B;IACzD,MAAM,EAAE,GAAG,IAAA,gBAAK,GAAE,CAAC;IACnB,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,SAAS,CAAC;IACvC,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,kBAAkB,CAAC,IAAI,CAAC,CAAC;IAC9D,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,cAAc,CAAC,IAAI,CAAC,CAAC;IAClD,MAAM,KAAK,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,GAAG,QAAQ,CAAC,CAAC,WAAW,EAAE,CAAC;IACnE,MAAM,QAAQ,GAAqB,EAAE,CAAC;IAEtC,WAAW;IACX,MAAM,QAAQ,GAAG,EAAE,CAAC,OAAO,CACzB,2DAA2D,CAC5D,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAkB,CAAC;IACxC,MAAM,SAAS,GAAG,EAAE,CAAC,OAAO,CAC1B,+EAA+E,CAChF,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,EAAE,KAAK,CAAkB,CAAC;IAE/C,QAAQ,CAAC,IAAI,CAAC;QACZ,IAAI,EAAE,UAAU;QAChB,KAAK,EAAE,UAAU;QACjB,OAAO,EAAE,GAAG,QAAQ,CAAC,CAAC,oBAAoB,SAAS,CAAC,CAAC,YAAY,IAAI,GAAG;QACxE,SAAS,EAAE,EAAE;QACb,UAAU,EAAE,EAAE;QACd,UAA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AC,CAAC;IACpB,CAAC;AACH,CAAC;AAED,SAAS,SAAS,CAAC,OAAe;IAChC,MAAM,EAAE,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,IAAI,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,CAAC;IACpD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,GAAG,OAAO,CAAC,CAAC;IACvC,IAAI,KAAK,GAAG,CAAC;QAAE,OAAO,UAAU,CAAC;IACjC,IAAI,KAAK,GAAG,EAAE;QAAE,OAAO,GAAG,KAAK,GAAG,CAAC;IACnC,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,EAAE,CAAC,CAAC;IACpC,IAAI,IAAI,GAAG,CAAC;QAAE,OAAO,GAAG,IAAI,GAAG,CAAC;IAChC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC;IACnC,OAAO,GAAG,KAAK,GAAG,CAAC;AACrB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface MemoryDigest {
|
|
2
|
+
project: string;
|
|
3
|
+
totalEvents: number;
|
|
4
|
+
last7d: number;
|
|
5
|
+
decisions: number;
|
|
6
|
+
errors: number;
|
|
7
|
+
fixes: number;
|
|
8
|
+
topTopics: string[];
|
|
9
|
+
mostActiveDay: string | null;
|
|
10
|
+
digestLines: string[];
|
|
11
|
+
}
|
|
12
|
+
export declare function generateMemoryDigest(project: string): MemoryDigest;
|
|
13
|
+
//# sourceMappingURL=memory-digest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"memory-digest.d.ts","sourceRoot":"","sources":["../../../../src/walls/06-memory/stores/memory-digest.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,YAAY,CAwClE"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.generateMemoryDigest = generateMemoryDigest;
|
|
4
|
+
const database_1 = require("../database/database");
|
|
5
|
+
function generateMemoryDigest(project) {
|
|
6
|
+
const db = (0, database_1.getDb)();
|
|
7
|
+
const totalRow = db.prepare('SELECT COUNT(*) as c FROM memory_events WHERE project = ?').get(project);
|
|
8
|
+
const since = new Date(Date.now() - 7 * 86400000).toISOString();
|
|
9
|
+
const recentRow = db.prepare('SELECT COUNT(*) as c FROM memory_events WHERE project = ? AND created_at >= ?').get(project, since);
|
|
10
|
+
const typeRows = db.prepare(`
|
|
11
|
+
SELECT type, COUNT(*) as c FROM memory_events WHERE project = ? GROUP BY type
|
|
12
|
+
`).all(project);
|
|
13
|
+
const topicRows = db.prepare(`
|
|
14
|
+
SELECT topic, COUNT(*) as c FROM memory_events
|
|
15
|
+
WHERE project = ? AND topic IS NOT NULL
|
|
16
|
+
GROUP BY topic ORDER BY c DESC LIMIT 5
|
|
17
|
+
`).all(project);
|
|
18
|
+
const dayRow = db.prepare(`
|
|
19
|
+
SELECT date(created_at) as d, COUNT(*) as c FROM memory_events
|
|
20
|
+
WHERE project = ? GROUP BY d ORDER BY c DESC LIMIT 1
|
|
21
|
+
`).get(project);
|
|
22
|
+
const map = {};
|
|
23
|
+
for (const r of typeRows)
|
|
24
|
+
map[r.type] = r.c;
|
|
25
|
+
const digestLines = [
|
|
26
|
+
`Total memories: ${totalRow.c}`,
|
|
27
|
+
`Last 7d: ${recentRow.c}`,
|
|
28
|
+
`Decisions: ${map.decision || 0}`,
|
|
29
|
+
`Errors/Fixes: ${map.error || 0}/${map.fix || 0}`,
|
|
30
|
+
`Top topics: ${topicRows.map((t) => t.topic).join(', ') || 'none'}`,
|
|
31
|
+
];
|
|
32
|
+
return {
|
|
33
|
+
project,
|
|
34
|
+
totalEvents: totalRow.c,
|
|
35
|
+
last7d: recentRow.c,
|
|
36
|
+
decisions: map.decision || 0,
|
|
37
|
+
errors: map.error || 0,
|
|
38
|
+
fixes: map.fix || 0,
|
|
39
|
+
topTopics: topicRows.map((t) => t.topic),
|
|
40
|
+
mostActiveDay: dayRow?.d || null,
|
|
41
|
+
digestLines,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=memory-digest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"memory-digest.js","sourceRoot":"","sources":["../../../../src/walls/06-memory/stores/memory-digest.ts"],"names":[],"mappings":";;AAcA,oDAwCC;AAtDD,mDAA6C;AAc7C,SAAgB,oBAAoB,CAAC,OAAe;IAClD,MAAM,EAAE,GAAG,IAAA,gBAAK,GAAE,CAAC;IACnB,MAAM,QAAQ,GAAG,EAAE,CAAC,OAAO,CAAC,2DAA2D,CAAC,CAAC,GAAG,CAAC,OAAO,CAAkB,CAAC;IACvH,MAAM,KAAK,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,QAAQ,CAAC,CAAC,WAAW,EAAE,CAAC;IAChE,MAAM,SAAS,GAAG,EAAE,CAAC,OAAO,CAAC,+EAA+E,CAAC,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAkB,CAAC;IACnJ,MAAM,QAAQ,GAAG,EAAE,CAAC,OAAO,CAAC;;GAE3B,CAAC,CAAC,GAAG,CAAC,OAAO,CAAuC,CAAC;IACtD,MAAM,SAAS,GAAG,EAAE,CAAC,OAAO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: 'A+' | 'A' | 'B+' | 'B' | 'C+' | 'C' | 'D' | 'F';
|
|
5
|
+
breakdown: {
|
|
6
|
+
completeness: number;
|
|
7
|
+
freshness: number;
|
|
8
|
+
quality: number;
|
|
9
|
+
balance: number;
|
|
10
|
+
engagement: number;
|
|
11
|
+
};
|
|
12
|
+
suggestions: string[];
|
|
13
|
+
metrics: {
|
|
14
|
+
totalEvents: number;
|
|
15
|
+
recentEvents7d: number;
|
|
16
|
+
avgImportance: number;
|
|
17
|
+
decisionsLogged: number;
|
|
18
|
+
errorsLogged: number;
|
|
19
|
+
fixesLogged: number;
|
|
20
|
+
verificationsLogged: number;
|
|
21
|
+
patternsLearned: number;
|
|
22
|
+
handoffCurrent: boolean;
|
|
23
|
+
styleProfileExists: boolean;
|
|
24
|
+
uniqueTopics: number;
|
|
25
|
+
daysSinceFirstEvent: number;
|
|
26
|
+
daysSinceLastEvent: number;
|
|
27
|
+
};
|
|
28
|
+
computedAt: string;
|
|
29
|
+
}
|
|
30
|
+
export declare function computeMemoryHealth(project: string): MemoryHealthScore;
|
|
31
|
+
export declare function formatHealthReport(health: MemoryHealthScore): string;
|
|
32
|
+
//# sourceMappingURL=memory-health.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"memory-health.d.ts","sourceRoot":"","sources":["../../../../src/walls/06-memory/stores/memory-health.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,IAAI,GAAG,GAAG,GAAG,IAAI,GAAG,GAAG,GAAG,IAAI,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;IACxD,SAAS,EAAE;QACT,YAAY,EAAE,MAAM,CAAC;QACrB,SAAS,EAAE,MAAM,CAAC;QAClB,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC;QAChB,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;IACF,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,OAAO,EAAE;QACP,WAAW,EAAE,MAAM,CAAC;QACpB,cAAc,EAAE,MAAM,CAAC;QACvB,aAAa,EAAE,MAAM,CAAC;QACtB,eAAe,EAAE,MAAM,CAAC;QACxB,YAAY,EAAE,MAAM,CAAC;QACrB,WAAW,EAAE,MAAM,CAAC;QACpB,mBAAmB,EAAE,MAAM,CAAC;QAC5B,eAAe,EAAE,MAAM,CAAC;QACxB,cAAc,EAAE,OAAO,CAAC;QACxB,kBAAkB,EAAE,OAAO,CAAC;QAC5B,YAAY,EAAE,MAAM,CAAC;QACrB,mBAAmB,EAAE,MAAM,CAAC;QAC5B,kBAAkB,EAAE,MAAM,CAAC;KAC5B,CAAC;IACF,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,iBAAiB,CAqLtE;AAaD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,iBAAiB,GAAG,MAAM,CAuCpE"}
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.computeMemoryHealth = computeMemoryHealth;
|
|
4
|
+
exports.formatHealthReport = formatHealthReport;
|
|
5
|
+
const database_1 = require("../database/database");
|
|
6
|
+
function computeMemoryHealth(project) {
|
|
7
|
+
const db = (0, database_1.getDb)();
|
|
8
|
+
const suggestions = [];
|
|
9
|
+
// Metrics
|
|
10
|
+
const totalRow = db.prepare('SELECT COUNT(*) as c FROM memory_events WHERE project = ?').get(project);
|
|
11
|
+
const since7d = new Date(Date.now() - 7 * 86400000).toISOString();
|
|
12
|
+
const since30d = new Date(Date.now() - 30 * 86400000).toISOString();
|
|
13
|
+
const recentRow = db.prepare('SELECT COUNT(*) as c FROM memory_events WHERE project = ? AND created_at >= ?').get(project, since7d);
|
|
14
|
+
const avgRow = db.prepare('SELECT AVG(importance) as a FROM memory_events WHERE project = ?').get(project);
|
|
15
|
+
const decisionsRow = db.prepare("SELECT COUNT(*) as c FROM memory_events WHERE project = ? AND type = 'decision'").get(project);
|
|
16
|
+
const errorsRow = db.prepare("SELECT COUNT(*) as c FROM memory_events WHERE project = ? AND type = 'error'").get(project);
|
|
17
|
+
const fixesRow = db.prepare("SELECT COUNT(*) as c FROM memory_events WHERE project = ? AND type = 'fix'").get(project);
|
|
18
|
+
const verificationsRow = db.prepare("SELECT COUNT(*) as c FROM memory_events WHERE project = ? AND type = 'verification'").get(project);
|
|
19
|
+
const patternsRow = db.prepare('SELECT COUNT(*) as c FROM memory_patterns WHERE project = ?').get(project);
|
|
20
|
+
const topicsRow = db.prepare('SELECT COUNT(DISTINCT topic) as c FROM memory_events WHERE project = ? AND topic IS NOT NULL').get(project);
|
|
21
|
+
const oldestRow = db.prepare('SELECT MIN(created_at) as o FROM memory_events WHERE project = ?').get(project);
|
|
22
|
+
const newestRow = db.prepare('SELECT MAX(created_at) as n FROM memory_events WHERE project = ?').get(project);
|
|
23
|
+
const daysSinceFirst = oldestRow.o ? Math.round((Date.now() - new Date(oldestRow.o).getTime()) / 86400000) : 0;
|
|
24
|
+
const daysSinceLast = newestRow.n ? Math.round((Date.now() - new Date(newestRow.n).getTime()) / 86400000) : 999;
|
|
25
|
+
// Handoff check
|
|
26
|
+
let handoffCurrent = false;
|
|
27
|
+
try {
|
|
28
|
+
const fs = require('fs');
|
|
29
|
+
const path = require('path');
|
|
30
|
+
const cellDir = path.join(process.cwd(), '.cell', 'handoff', 'current.md');
|
|
31
|
+
handoffCurrent = fs.existsSync(cellDir);
|
|
32
|
+
}
|
|
33
|
+
catch { }
|
|
34
|
+
// Style check
|
|
35
|
+
let styleProfileExists = false;
|
|
36
|
+
try {
|
|
37
|
+
const styleRow = db.prepare('SELECT COUNT(*) as c FROM style_profiles WHERE project = ?').get(project);
|
|
38
|
+
styleProfileExists = styleRow.c > 0;
|
|
39
|
+
}
|
|
40
|
+
catch { }
|
|
41
|
+
const metrics = {
|
|
42
|
+
totalEvents: totalRow.c,
|
|
43
|
+
recentEvents7d: recentRow.c,
|
|
44
|
+
avgImportance: Math.round((avgRow.a || 0) * 10) / 10,
|
|
45
|
+
decisionsLogged: decisionsRow.c,
|
|
46
|
+
errorsLogged: errorsRow.c,
|
|
47
|
+
fixesLogged: fixesRow.c,
|
|
48
|
+
verificationsLogged: verificationsRow.c,
|
|
49
|
+
patternsLearned: patternsRow.c,
|
|
50
|
+
handoffCurrent,
|
|
51
|
+
styleProfileExists,
|
|
52
|
+
uniqueTopics: topicsRow.c,
|
|
53
|
+
daysSinceFirstEvent: daysSinceFirst,
|
|
54
|
+
daysSinceLastEvent: daysSinceLast,
|
|
55
|
+
};
|
|
56
|
+
// Completeness score (0-100): do you have all event types?
|
|
57
|
+
let completeness = 0;
|
|
58
|
+
if (metrics.totalEvents > 0)
|
|
59
|
+
completeness += 10;
|
|
60
|
+
if (metrics.decisionsLogged > 0)
|
|
61
|
+
completeness += 20;
|
|
62
|
+
if (metrics.errorsLogged > 0)
|
|
63
|
+
completeness += 15;
|
|
64
|
+
if (metrics.fixesLogged > 0)
|
|
65
|
+
completeness += 15;
|
|
66
|
+
if (metrics.verificationsLogged > 0)
|
|
67
|
+
completeness += 15;
|
|
68
|
+
if (metrics.patternsLearned > 0)
|
|
69
|
+
completeness += 15;
|
|
70
|
+
if (metrics.handoffCurrent)
|
|
71
|
+
completeness += 10;
|
|
72
|
+
if (metrics.decisionsLogged === 0)
|
|
73
|
+
suggestions.push('Log decisions with `cell memory record --type decision`');
|
|
74
|
+
if (metrics.verificationsLogged === 0)
|
|
75
|
+
suggestions.push('Log test runs with `cell memory record --type verification`');
|
|
76
|
+
if (metrics.patternsLearned === 0)
|
|
77
|
+
suggestions.push('Learn patterns with `cell memory record --type pattern`');
|
|
78
|
+
// Freshness score (0-100): how recent is data?
|
|
79
|
+
let freshness = 100;
|
|
80
|
+
if (metrics.daysSinceLastEvent > 1)
|
|
81
|
+
freshness -= 10;
|
|
82
|
+
if (metrics.daysSinceLastEvent > 3)
|
|
83
|
+
freshness -= 20;
|
|
84
|
+
if (metrics.daysSinceLastEvent > 7)
|
|
85
|
+
freshness -= 30;
|
|
86
|
+
if (metrics.daysSinceLastEvent > 14)
|
|
87
|
+
freshness -= 20;
|
|
88
|
+
if (metrics.recentEvents7d === 0)
|
|
89
|
+
freshness -= 20;
|
|
90
|
+
if (metrics.daysSinceLastEvent > 7)
|
|
91
|
+
suggestions.push('Update handoff context — it may be stale');
|
|
92
|
+
// Quality score (0-100): avg importance + error ratio
|
|
93
|
+
let quality = 50;
|
|
94
|
+
if (metrics.avgImportance > 5)
|
|
95
|
+
quality += 20;
|
|
96
|
+
else if (metrics.avgImportance > 3)
|
|
97
|
+
quality += 10;
|
|
98
|
+
if (metrics.avgImportance > 7)
|
|
99
|
+
quality += 10;
|
|
100
|
+
const errorRate = metrics.totalEvents > 0 ? metrics.errorsLogged / metrics.totalEvents : 0;
|
|
101
|
+
if (errorRate < 0.1)
|
|
102
|
+
quality += 20;
|
|
103
|
+
else if (errorRate < 0.2)
|
|
104
|
+
quality += 10;
|
|
105
|
+
else
|
|
106
|
+
quality -= 10;
|
|
107
|
+
if (metrics.fixesLogged > metrics.errorsLogged)
|
|
108
|
+
quality += 10;
|
|
109
|
+
// Balance score (0-100): ratio of different event types
|
|
110
|
+
const typeCounts = {};
|
|
111
|
+
const typeRows = db.prepare('SELECT type, COUNT(*) as c FROM memory_events WHERE project = ? GROUP BY type').all(project);
|
|
112
|
+
for (const r of typeRows)
|
|
113
|
+
typeCounts[r.type] = r.c;
|
|
114
|
+
const types = Object.keys(typeCounts).length;
|
|
115
|
+
let balance = Math.min(types * 12, 60);
|
|
116
|
+
if (types >= 5)
|
|
117
|
+
balance += 20;
|
|
118
|
+
if (types >= 8)
|
|
119
|
+
balance += 20;
|
|
120
|
+
if (types < 3)
|
|
121
|
+
suggestions.push('Record more diverse event types (errors, fixes, decisions)');
|
|
122
|
+
// Engagement score (0-100): consistency of recording
|
|
123
|
+
let engagement = 0;
|
|
124
|
+
if (metrics.totalEvents > 5)
|
|
125
|
+
engagement += 20;
|
|
126
|
+
if (metrics.totalEvents > 20)
|
|
127
|
+
engagement += 20;
|
|
128
|
+
if (metrics.totalEvents > 50)
|
|
129
|
+
engagement += 20;
|
|
130
|
+
if (metrics.recentEvents7d > 0)
|
|
131
|
+
engagement += 20;
|
|
132
|
+
if (metrics.recentEvents7d > 5)
|
|
133
|
+
engagement += 10;
|
|
134
|
+
if (metrics.uniqueTopics > 3)
|
|
135
|
+
engagement += 10;
|
|
136
|
+
if (metrics.totalEvents < 10)
|
|
137
|
+
suggestions.push('Record more events to build memory depth');
|
|
138
|
+
// Overall score
|
|
139
|
+
const overallScore = Math.round(completeness * 0.25 +
|
|
140
|
+
freshness * 0.20 +
|
|
141
|
+
quality * 0.20 +
|
|
142
|
+
balance * 0.15 +
|
|
143
|
+
engagement * 0.20);
|
|
144
|
+
const grade = scoreToGrade(overallScore);
|
|
145
|
+
if (overallScore < 50)
|
|
146
|
+
suggestions.push('Memory system needs attention — run `cell memory health` regularly');
|
|
147
|
+
if (!metrics.handoffCurrent)
|
|
148
|
+
suggestions.push('Create a handoff with `cell handoff --log`');
|
|
149
|
+
if (!metrics.styleProfileExists)
|
|
150
|
+
suggestions.push('Set up your style profile with `cell style update`');
|
|
151
|
+
return {
|
|
152
|
+
project,
|
|
153
|
+
overallScore,
|
|
154
|
+
grade,
|
|
155
|
+
breakdown: {
|
|
156
|
+
completeness,
|
|
157
|
+
freshness,
|
|
158
|
+
quality,
|
|
159
|
+
balance,
|
|
160
|
+
engagement,
|
|
161
|
+
},
|
|
162
|
+
suggestions: [...new Set(suggestions)].slice(0, 8),
|
|
163
|
+
metrics,
|
|
164
|
+
computedAt: new Date().toISOString(),
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
function scoreToGrade(score) {
|
|
168
|
+
if (score >= 95)
|
|
169
|
+
return 'A+';
|
|
170
|
+
if (score >= 90)
|
|
171
|
+
return 'A';
|
|
172
|
+
if (score >= 85)
|
|
173
|
+
return 'B+';
|
|
174
|
+
if (score >= 75)
|
|
175
|
+
return 'B';
|
|
176
|
+
if (score >= 70)
|
|
177
|
+
return 'C+';
|
|
178
|
+
if (score >= 60)
|
|
179
|
+
return 'C';
|
|
180
|
+
if (score >= 40)
|
|
181
|
+
return 'D';
|
|
182
|
+
return 'F';
|
|
183
|
+
}
|
|
184
|
+
function formatHealthReport(health) {
|
|
185
|
+
const lines = [];
|
|
186
|
+
lines.push(`## Memory Health — ${health.project}`);
|
|
187
|
+
lines.push(`**Score: ${health.overallScore}/100 (${health.grade})**\n`);
|
|
188
|
+
lines.push('### Breakdown');
|
|
189
|
+
lines.push(`| Dimension | Score |`);
|
|
190
|
+
lines.push(`|-----------|-------|`);
|
|
191
|
+
lines.push(`| Completeness | ${health.breakdown.completeness} |`);
|
|
192
|
+
lines.push(`| Freshness | ${health.breakdown.freshness} |`);
|
|
193
|
+
lines.push(`| Quality | ${health.breakdown.quality} |`);
|
|
194
|
+
lines.push(`| Balance | ${health.breakdown.balance} |`);
|
|
195
|
+
lines.push(`| Engagement | ${health.breakdown.engagement} |`);
|
|
196
|
+
lines.push('');
|
|
197
|
+
lines.push('### Metrics');
|
|
198
|
+
lines.push(`| Metric | Value |`);
|
|
199
|
+
lines.push(`|--------|-------|`);
|
|
200
|
+
lines.push(`| Total events | ${health.metrics.totalEvents} |`);
|
|
201
|
+
lines.push(`| Last 7d events | ${health.metrics.recentEvents7d} |`);
|
|
202
|
+
lines.push(`| Avg importance | ${health.metrics.avgImportance} |`);
|
|
203
|
+
lines.push(`| Decisions | ${health.metrics.decisionsLogged} |`);
|
|
204
|
+
lines.push(`| Errors | ${health.metrics.errorsLogged} |`);
|
|
205
|
+
lines.push(`| Fixes | ${health.metrics.fixesLogged} |`);
|
|
206
|
+
lines.push(`| Verifications | ${health.metrics.verificationsLogged} |`);
|
|
207
|
+
lines.push(`| Patterns | ${health.metrics.patternsLearned} |`);
|
|
208
|
+
lines.push(`| Unique topics | ${health.metrics.uniqueTopics} |`);
|
|
209
|
+
lines.push(`| Handoff current | ${health.metrics.handoffCurrent ? 'yes' : 'no'} |`);
|
|
210
|
+
lines.push(`| Style profile | ${health.metrics.styleProfileExists ? 'yes' : 'no'} |`);
|
|
211
|
+
lines.push(`| Days tracked | ${health.metrics.daysSinceFirstEvent} |`);
|
|
212
|
+
lines.push('');
|
|
213
|
+
if (health.suggestions.length > 0) {
|
|
214
|
+
lines.push('### Suggestions');
|
|
215
|
+
for (const s of health.suggestions)
|
|
216
|
+
lines.push(`- ${s}`);
|
|
217
|
+
lines.push('');
|
|
218
|
+
}
|
|
219
|
+
return lines.join('\n');
|
|
220
|
+
}
|
|
221
|
+
//# sourceMappingURL=memory-health.js.map
|