composto-ai 0.4.0 → 0.4.1
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 +3 -2
- package/dist/index.js +8 -8
- package/dist/mcp/server.js +1 -1
- package/dist/memory/worker.js +23 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -227,8 +227,9 @@ Overall compression: 89.2%
|
|
|
227
227
|
L0 compression: 97.5%
|
|
228
228
|
AST engine: 51/51 files (0 regex fallback)
|
|
229
229
|
Languages: TypeScript, JavaScript, Python, Go, Rust
|
|
230
|
-
Tests:
|
|
231
|
-
BlastRadius v1: precision
|
|
230
|
+
Tests: 224 passing
|
|
231
|
+
BlastRadius v1: precision 90-96%, recall 99-100% on 3 repos
|
|
232
|
+
(composto, picomatch, zod; medium|high band)
|
|
232
233
|
```
|
|
233
234
|
|
|
234
235
|
---
|
package/dist/index.js
CHANGED
|
@@ -2567,7 +2567,7 @@ function statFileSize(path) {
|
|
|
2567
2567
|
function runScan(projectPath) {
|
|
2568
2568
|
const adapter = new CLIAdapter();
|
|
2569
2569
|
const config = loadConfig(projectPath);
|
|
2570
|
-
console.log("composto v0.4.
|
|
2570
|
+
console.log("composto v0.4.1 \u2014 scanning...\n");
|
|
2571
2571
|
const files = collectFiles(projectPath, [".ts", ".tsx", ".js", ".jsx"]);
|
|
2572
2572
|
console.log(` Found ${files.length} files
|
|
2573
2573
|
`);
|
|
@@ -2594,7 +2594,7 @@ function runScan(projectPath) {
|
|
|
2594
2594
|
function runTrends(projectPath) {
|
|
2595
2595
|
const adapter = new CLIAdapter();
|
|
2596
2596
|
const config = loadConfig(projectPath);
|
|
2597
|
-
console.log("composto v0.4.
|
|
2597
|
+
console.log("composto v0.4.1 \u2014 trend analysis...\n");
|
|
2598
2598
|
const entries = getGitLog(projectPath, 100);
|
|
2599
2599
|
if (entries.length === 0) {
|
|
2600
2600
|
console.log(" No git history found.\n");
|
|
@@ -2636,7 +2636,7 @@ async function runIR(projectPath, filePath, layer) {
|
|
|
2636
2636
|
}
|
|
2637
2637
|
var ALL_EXTENSIONS = [".ts", ".tsx", ".js", ".jsx", ".mjs", ".py", ".go", ".rs"];
|
|
2638
2638
|
async function runBenchmark(projectPath) {
|
|
2639
|
-
console.log("composto v0.4.
|
|
2639
|
+
console.log("composto v0.4.1 \u2014 benchmark\n");
|
|
2640
2640
|
const files = collectFiles(projectPath, ALL_EXTENSIONS);
|
|
2641
2641
|
console.log(` ${files.length} files
|
|
2642
2642
|
`);
|
|
@@ -2683,7 +2683,7 @@ async function runBenchmarkQuality(projectPath, filePath) {
|
|
|
2683
2683
|
}
|
|
2684
2684
|
const code = readFileSync4(filePath, "utf-8");
|
|
2685
2685
|
const relPath = relative2(projectPath, filePath);
|
|
2686
|
-
console.log("composto v0.4.
|
|
2686
|
+
console.log("composto v0.4.1 \u2014 quality benchmark\n");
|
|
2687
2687
|
console.log(` File: ${relPath}
|
|
2688
2688
|
`);
|
|
2689
2689
|
console.log(" Sending to Claude Haiku...\n");
|
|
@@ -2713,8 +2713,8 @@ ${result.ir.response}
|
|
|
2713
2713
|
}
|
|
2714
2714
|
}
|
|
2715
2715
|
async function runContext(projectPath, budget, target) {
|
|
2716
|
-
const header = target ? `composto v0.4.
|
|
2717
|
-
` : `composto v0.4.
|
|
2716
|
+
const header = target ? `composto v0.4.1 \u2014 context (target: ${target}, budget: ${budget} tokens)
|
|
2717
|
+
` : `composto v0.4.1 \u2014 context (budget: ${budget} tokens)
|
|
2718
2718
|
`;
|
|
2719
2719
|
console.log(header);
|
|
2720
2720
|
const files = collectFiles(projectPath, ALL_EXTENSIONS);
|
|
@@ -2930,10 +2930,10 @@ switch (command) {
|
|
|
2930
2930
|
break;
|
|
2931
2931
|
}
|
|
2932
2932
|
case "version":
|
|
2933
|
-
console.log("composto v0.4.
|
|
2933
|
+
console.log("composto v0.4.1");
|
|
2934
2934
|
break;
|
|
2935
2935
|
default:
|
|
2936
|
-
console.log("composto v0.4.
|
|
2936
|
+
console.log("composto v0.4.1 \u2014 less tokens, more insight\n");
|
|
2937
2937
|
console.log("Commands:");
|
|
2938
2938
|
console.log(" scan [path] Scan codebase for issues");
|
|
2939
2939
|
console.log(" trends [path] Analyze codebase health trends");
|
package/dist/mcp/server.js
CHANGED
|
@@ -2366,7 +2366,7 @@ var MemoryAPI = class {
|
|
|
2366
2366
|
var ALL_EXTENSIONS = [".ts", ".tsx", ".js", ".jsx", ".mjs", ".py", ".go", ".rs"];
|
|
2367
2367
|
var server = new McpServer({
|
|
2368
2368
|
name: "composto",
|
|
2369
|
-
version: "0.4.
|
|
2369
|
+
version: "0.4.1"
|
|
2370
2370
|
});
|
|
2371
2371
|
server.tool(
|
|
2372
2372
|
"composto_ir",
|
package/dist/memory/worker.js
CHANGED
|
@@ -354,10 +354,24 @@ function parseLogOutput(output) {
|
|
|
354
354
|
}
|
|
355
355
|
return commits;
|
|
356
356
|
}
|
|
357
|
+
function resolveRevertsSha(raw, knownShas) {
|
|
358
|
+
if (!raw) return null;
|
|
359
|
+
if (knownShas.has(raw)) return raw;
|
|
360
|
+
if (raw.length < 40) {
|
|
361
|
+
for (const sha of knownShas) {
|
|
362
|
+
if (sha.startsWith(raw)) return sha;
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
return null;
|
|
366
|
+
}
|
|
357
367
|
function ingestRange(db, repoPath, range) {
|
|
358
368
|
const raw = logRange(repoPath, range.from, range.to);
|
|
359
369
|
const commits = parseLogOutput(raw);
|
|
360
370
|
commits.sort((a, b) => a.timestamp - b.timestamp);
|
|
371
|
+
const knownShas = new Set(commits.map((c) => c.sha));
|
|
372
|
+
for (const existing of db.prepare(`SELECT sha FROM commits`).all()) {
|
|
373
|
+
knownShas.add(existing.sha);
|
|
374
|
+
}
|
|
361
375
|
const insertCommit = db.prepare(`
|
|
362
376
|
INSERT OR IGNORE INTO commits
|
|
363
377
|
(sha, parent_sha, author, timestamp, subject, is_fix, is_revert, reverts_sha)
|
|
@@ -383,16 +397,21 @@ function ingestRange(db, repoPath, range) {
|
|
|
383
397
|
c.subject,
|
|
384
398
|
parsed.is_fix ? 1 : 0,
|
|
385
399
|
parsed.is_revert ? 1 : 0,
|
|
386
|
-
parsed.reverts_sha
|
|
400
|
+
resolveRevertsSha(parsed.reverts_sha, knownShas)
|
|
387
401
|
);
|
|
388
402
|
for (const t of c.touches) {
|
|
389
403
|
insertTouch.run(c.sha, t.file_path, t.adds, t.dels, t.change_type);
|
|
390
404
|
}
|
|
391
405
|
}
|
|
392
406
|
});
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
407
|
+
db.pragma("foreign_keys = OFF");
|
|
408
|
+
try {
|
|
409
|
+
const BATCH = 1e3;
|
|
410
|
+
for (let i = 0; i < commits.length; i += BATCH) {
|
|
411
|
+
tx(commits.slice(i, i + BATCH));
|
|
412
|
+
}
|
|
413
|
+
} finally {
|
|
414
|
+
db.pragma("foreign_keys = ON");
|
|
396
415
|
}
|
|
397
416
|
deriveFixLinks(db);
|
|
398
417
|
if (shouldRefresh(db, range.to)) {
|