lore-memory 0.5.1 ā 0.5.2
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/README.md +7 -0
- package/bin/lore.js +1 -0
- package/package.json +1 -1
- package/src/commands/graph.js +10 -4
- package/src/commands/log.js +9 -1
- package/src/commands/score.js +12 -7
- package/src/lib/entries.js +2 -1
- package/src/lib/scorer.js +1 -1
package/README.md
CHANGED
|
@@ -143,6 +143,13 @@ Add the MCP server to your Claude Code config (`~/.claude/settings.json`):
|
|
|
143
143
|
}
|
|
144
144
|
```
|
|
145
145
|
|
|
146
|
+
### š”ļø Autonomous AI Integration (Zero-Prompt)
|
|
147
|
+
To make Claude autonomously respect your codebase rules without you ever having to ask it, drop a `CLAUDE.md` (or `.cursorrules` / `.clinerules`) file in the root of your project with this exact instruction:
|
|
148
|
+
|
|
149
|
+
> **"Before you modify, create, or explain any file in this codebase, you must ALWAYS execute the `lore_why` tool on that file path first to check if there are any architectural invariants, gotchas, or decisions you need to respect."**
|
|
150
|
+
|
|
151
|
+
Once added, the AI will autonomously query Lore in the background before it writes a single line of code, ensuring it never violates your team's architectural constraints.
|
|
152
|
+
|
|
146
153
|
---
|
|
147
154
|
|
|
148
155
|
## š Privacy & Data
|
package/bin/lore.js
CHANGED
|
@@ -130,6 +130,7 @@ program
|
|
|
130
130
|
.option('--tradeoffs <tradeoffs>', 'Tradeoffs')
|
|
131
131
|
.option('--tags <tags>', 'Comma-separated tags')
|
|
132
132
|
.option('--files <files>', 'Comma-separated file paths')
|
|
133
|
+
.option('--file <file>', 'Alias for --files')
|
|
133
134
|
.action(require('../src/commands/log'));
|
|
134
135
|
|
|
135
136
|
program
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lore-memory",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.2",
|
|
4
4
|
"description": "Persistent project memory for developers. Captures decisions, invariants, gotchas, and graveyard entries ā automatically and manually ā and injects them into AI coding sessions.",
|
|
5
5
|
"main": "bin/lore.js",
|
|
6
6
|
"bin": {
|
package/src/commands/graph.js
CHANGED
|
@@ -39,19 +39,25 @@ function graph(filepath, options) {
|
|
|
39
39
|
const index = readIndex();
|
|
40
40
|
const normalized = path.relative(projectRoot, path.resolve(filepath)).replace(/\\/g, '/');
|
|
41
41
|
|
|
42
|
-
const
|
|
42
|
+
const importsArr = g.imports[normalized];
|
|
43
43
|
const importedBy = g.importedBy[normalized] || [];
|
|
44
44
|
|
|
45
|
-
if (
|
|
46
|
-
console.log(chalk.yellow(
|
|
47
|
-
console.log(chalk.dim(' Run: lore graph --build to
|
|
45
|
+
if (importsArr === undefined) {
|
|
46
|
+
console.log(chalk.yellow(`${filepath} is not in the dependency graph.`));
|
|
47
|
+
console.log(chalk.dim(' Run: lore graph --build to index project files'));
|
|
48
48
|
return;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
+
const imports = importsArr;
|
|
51
52
|
const entryCount = (file) => (index.files[file] || []).length;
|
|
52
53
|
|
|
53
54
|
console.log(chalk.cyan(`\nš ${filepath}\n`));
|
|
54
55
|
|
|
56
|
+
if (imports.length === 0 && importedBy.length === 0) {
|
|
57
|
+
console.log(chalk.dim(' No internal project imports or dependents found.'));
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
|
|
55
61
|
if (imports.length > 0) {
|
|
56
62
|
console.log(chalk.bold('Imports:'));
|
|
57
63
|
for (const dep of imports) {
|
package/src/commands/log.js
CHANGED
|
@@ -14,6 +14,13 @@ async function log(options) {
|
|
|
14
14
|
|
|
15
15
|
let type, title, context, alternatives, tradeoffs, tags, files;
|
|
16
16
|
|
|
17
|
+
// If --title or --context is given without the other, error rather than falling through to interactive
|
|
18
|
+
if ((options.title && !options.context) || (!options.title && options.context)) {
|
|
19
|
+
const missing = !options.title ? '--title' : '--context';
|
|
20
|
+
console.error(chalk.red(`${missing} is required when using non-interactive mode`));
|
|
21
|
+
process.exit(1);
|
|
22
|
+
}
|
|
23
|
+
|
|
17
24
|
// Inline mode: all three required fields provided as flags
|
|
18
25
|
if (options.type && options.title && options.context) {
|
|
19
26
|
type = options.type;
|
|
@@ -22,7 +29,8 @@ async function log(options) {
|
|
|
22
29
|
alternatives = options.alternatives ? [options.alternatives] : [];
|
|
23
30
|
tradeoffs = options.tradeoffs || '';
|
|
24
31
|
tags = options.tags ? options.tags.split(',').map(t => t.trim()).filter(Boolean) : [];
|
|
25
|
-
|
|
32
|
+
const rawFiles = options.files || options.file || '';
|
|
33
|
+
files = rawFiles ? rawFiles.split(',').map(f => f.trim()).filter(Boolean) : [];
|
|
26
34
|
} else {
|
|
27
35
|
// Interactive mode
|
|
28
36
|
const recentFiles = getRecentFiles();
|
package/src/commands/score.js
CHANGED
|
@@ -38,13 +38,18 @@ function score() {
|
|
|
38
38
|
console.log();
|
|
39
39
|
|
|
40
40
|
// Coverage
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
41
|
+
if (result.activeModules === 0) {
|
|
42
|
+
console.log(chalk.dim(`Coverage N/A`));
|
|
43
|
+
console.log(chalk.dim(` No active modules in recent git history`));
|
|
44
|
+
} else {
|
|
45
|
+
const cColor = result.coverage >= 70 ? chalk.green : result.coverage >= 40 ? chalk.yellow : chalk.red;
|
|
46
|
+
console.log(cColor(`Coverage ${result.coverage}/100`));
|
|
47
|
+
console.log(chalk.dim(` ${bar(result.coverage)} ${result.coveredModules}/${result.activeModules} active modules documented`));
|
|
48
|
+
if (result.topUnlogged.length > 0) {
|
|
49
|
+
console.log(chalk.yellow(' Highest risk unlogged modules:'));
|
|
50
|
+
for (const { module: mod, commits } of result.topUnlogged) {
|
|
51
|
+
console.log(chalk.yellow(` ${mod} ā ${commits} commits`));
|
|
52
|
+
}
|
|
48
53
|
}
|
|
49
54
|
}
|
|
50
55
|
console.log();
|
package/src/lib/entries.js
CHANGED
package/src/lib/scorer.js
CHANGED
|
@@ -53,7 +53,7 @@ function getModulesWithEntries(index) {
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
function calcCoverage(activeModules, modulesWithEntries) {
|
|
56
|
-
if (activeModules.length === 0) return
|
|
56
|
+
if (activeModules.length === 0) return 50; // neutral ā no data, displayed as N/A
|
|
57
57
|
const covered = activeModules.filter(m => modulesWithEntries.has(m)).length;
|
|
58
58
|
return Math.round((covered / activeModules.length) * 100);
|
|
59
59
|
}
|